codex-mobile-re 0.1.129 → 0.1.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{e as X,r as f,x as w,L as Z,av as tt,aw as at,f as c,i as v,j as e,t as n,u as i,k as x,p as B,ax as A,F as et,l as ot,P as U,w as I,n as st,h as L,ay as F,v as nt,c as _,_ as ut}from"./index-rc4ZsEIH.js";const it={class:"automations-panel"},lt={class:"automations-toolbar"},rt={class:"automations-summary"},ct={class:"automations-actions"},dt=["title"],mt=["disabled"],pt={key:0,class:"automations-error"},vt={key:1,class:"automations-empty"},ht={key:2,class:"automations-empty"},ft={key:3,class:"automations-layout"},_t=["aria-label"],yt=["onClick","onKeydown"],bt=["data-status"],gt={class:"automation-row-main"},At={class:"automation-row-title"},Lt={class:"automation-row-meta"},Et={class:"automation-row-side"},kt=["data-status"],Ct={class:"automation-row-schedule"},wt=["onClick"],It=["aria-label"],jt={class:"automation-detail-heading"},Rt=["data-status"],Tt={class:"automation-detail-title-wrap"},$t={class:"automation-detail-grid"},Kt=["title"],Nt={class:"automation-detail-prompt"},Pt=X({__name:"AutomationsPanel",props:{groups:{},projectCwdByName:{},projectDisplayNameById:{},selectedAutomationId:{}},emits:["select-automation","edit-automation","create-automation"],setup(V,{expose:Q,emit:Y}){const h=V,E=Y,j=f({}),R=f({}),{t:s}=nt(),y=f(!1),b=f(""),d=f(h.selectedAutomationId??""),p=f(""),z=_(()=>{const t=new Map;for(const a of h.groups)for(const o of a.threads)t.set(o.id,o.title);return t}),H=_(()=>{var a,o;const t=new Map;for(const l of h.groups){const u=(a=h.projectCwdByName[l.projectName])==null?void 0:a.trim(),g=((o=h.projectDisplayNameById[l.projectName])==null?void 0:o.trim())||l.projectName;u&&t.set(u,g)}return t}),m=_(()=>{const t=[];for(const[a,o]of Object.entries(j.value)){const l=z.value.get(a)??a;for(const u of o)t.push({rowKey:N("thread",a,u.id),automation:u,scope:"thread",scopeLabel:s("Heartbeat"),targetLabel:l,targetTitle:a,scheduleLabel:P(u)})}for(const[a,o]of Object.entries(R.value)){const l=H.value.get(a)??J(a);for(const u of o)t.push({rowKey:N("project",a,u.id),automation:u,scope:"project",scopeLabel:s("Project"),targetLabel:l,targetTitle:a,scheduleLabel:P(u)})}return t.sort((a,o)=>{const l=a.automation.status==="ACTIVE"?0:1,u=o.automation.status==="ACTIVE"?0:1;if(l!==u)return l-u;const g=a.automation.createdAtMs??0,M=o.automation.createdAtMs??0;if(g!==M)return M-g;const D=a.automation.updatedAtMs??0,S=o.automation.updatedAtMs??0;return D!==S?S-D:a.automation.name.localeCompare(o.automation.name)})}),O=_(()=>m.value.filter(t=>t.automation.status==="ACTIVE").length),W=_(()=>m.value.filter(t=>t.automation.status==="PAUSED").length),r=_(()=>m.value.find(t=>t.rowKey===p.value)??m.value.find(t=>t.automation.id===d.value)??m.value[0]??null);w(()=>h.selectedAutomationId,t=>{t&&(d.value=t,p.value=K(t))}),w(d,t=>{t&&E("select-automation",t)}),w(m,t=>{if(t.length===0){d.value="",p.value="";return}if(!(p.value&&t.some(a=>a.rowKey===p.value))){if(d.value&&t.some(a=>a.automation.id===d.value)){p.value=K(d.value);return}(!d.value||!t.some(a=>a.automation.id===d.value))&&(d.value=t[0].automation.id,p.value=t[0].rowKey)}}),Z(()=>{k()}),Q({loadAutomations:k});async function k(){y.value=!0,b.value="";try{const[t,a]=await Promise.all([tt(),at()]);j.value=t,R.value=a}catch(t){b.value=t instanceof Error?t.message:s("Failed to load automations")}finally{y.value=!1}}function T(t){return s(t==="PAUSED"?"Paused":"Active")}function $(t){E("edit-automation",{scope:t.scope,target:t.targetTitle,automation:t.automation})}function q(){E("create-automation")}function C(t){p.value=t.rowKey,d.value=t.automation.id}function K(t){var a;return((a=m.value.find(o=>o.automation.id===t))==null?void 0:a.rowKey)??""}function N(t,a,o){return`${t}:${a}:${o}`}function P(t){var o,l;if(t.status==="PAUSED")return s("Paused");if(t.nextRunAtMs)return`${s("Next")} ${G(t.nextRunAtMs)}`;const a=t.rrule.trim();if(/FREQ=MINUTELY/i.test(a)){const u=((o=/INTERVAL=(\d+)/i.exec(a))==null?void 0:o[1])??"1";return u==="1"?s("Every minute"):`${s("Every")} ${u} ${s("minutes")}`}if(/FREQ=HOURLY/i.test(a)){const u=((l=/INTERVAL=(\d+)/i.exec(a))==null?void 0:l[1])??"1";return u==="1"?s("Hourly"):`${s("Every")} ${u} ${s("hours")}`}return/FREQ=DAILY/i.test(a)?s("Daily"):/FREQ=WEEKLY/i.test(a)?s("Weekly"):s("Custom schedule")}function G(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function J(t){return t.replace(/\/+$/,"").split("/").filter(Boolean).pop()??t}return(t,a)=>(c(),v("div",it,[e("div",lt,[e("div",rt,[e("span",null,n(m.value.length)+" "+n(i(s)("total")),1),e("span",null,n(O.value)+" "+n(i(s)("active")),1),e("span",null,n(W.value)+" "+n(i(s)("paused")),1)]),e("div",ct,[e("button",{class:"automations-create",type:"button",title:i(s)("Create a new automation"),onClick:q},n(i(s)("New automation")),9,dt),e("button",{class:"automations-refresh",type:"button",disabled:y.value,onClick:k},n(y.value?i(s)("Refreshing..."):i(s)("Refresh")),9,mt)])]),b.value?(c(),v("p",pt,n(b.value),1)):x("",!0),y.value&&m.value.length===0?(c(),v("div",vt,[B(A,{class:"automations-empty-icon"}),e("p",null,n(i(s)("Loading automations...")),1)])):m.value.length===0?(c(),v("div",ht,[B(A,{class:"automations-empty-icon"}),e("p",null,n(i(s)("No automations yet")),1),e("span",null,n(i(s)("Use a thread or project menu to add an automation.")),1)])):(c(),v("div",ft,[e("section",{class:"automations-list","aria-label":i(s)("Automations")},[(c(!0),v(et,null,ot(m.value,o=>(c(),v("div",{key:o.rowKey,class:st(["automation-row",{"is-selected":p.value===o.rowKey}]),role:"button",tabindex:"0",onClick:l=>C(o),onKeydown:[U(I(l=>C(o),["prevent"]),["enter"]),U(I(l=>C(o),["prevent"]),["space"])]},[e("span",{class:"automation-row-icon","data-status":o.automation.status},[o.automation.status==="PAUSED"?(c(),L(F,{key:0})):(c(),L(A,{key:1}))],8,bt),e("span",gt,[e("span",At,n(o.automation.name),1),e("span",Lt,n(o.scopeLabel)+" • "+n(o.targetLabel),1)]),e("span",Et,[e("span",{class:"automation-row-status","data-status":o.automation.status},n(T(o.automation.status)),9,kt),e("span",Ct,n(o.scheduleLabel),1)]),e("button",{class:"automation-edit-button",type:"button",onClick:I(l=>$(o),["stop"])},n(i(s)("Edit")),9,wt)],42,yt))),128))],8,_t),r.value?(c(),v("aside",{key:0,class:"automation-detail","aria-label":i(s)("Automation details")},[e("div",jt,[e("span",{class:"automation-detail-icon","data-status":r.value.automation.status},[r.value.automation.status==="PAUSED"?(c(),L(F,{key:0})):(c(),L(A,{key:1}))],8,Rt),e("div",Tt,[e("h2",null,n(r.value.automation.name),1),e("span",null,n(r.value.scopeLabel),1)]),e("button",{class:"automation-detail-edit",type:"button",onClick:a[0]||(a[0]=o=>$(r.value))},n(i(s)("Edit")),1)]),e("dl",$t,[e("div",null,[e("dt",null,n(i(s)("Status")),1),e("dd",null,n(T(r.value.automation.status)),1)]),e("div",null,[e("dt",null,n(i(s)("Schedule")),1),e("dd",null,n(r.value.scheduleLabel),1)]),e("div",null,[e("dt",null,n(i(s)("Target")),1),e("dd",{title:r.value.targetTitle},n(r.value.targetLabel),9,Kt)]),e("div",null,[a[1]||(a[1]=e("dt",null,"ID",-1)),e("dd",null,n(r.value.automation.id),1)])]),e("section",Nt,[e("h3",null,n(i(s)("Prompt")),1),e("p",null,n(r.value.automation.prompt),1)])],8,It)):x("",!0)]))]))}}),Dt=ut(Pt,[["__scopeId","data-v-3d9a9b4b"]]);export{Dt as default};
1
+ import{e as X,r as f,x as w,M as Z,aI as tt,aJ as at,f as c,i as v,j as e,t as n,u as i,k as B,p as x,aK as A,F as et,l as ot,Q as U,w as I,n as st,h as L,aL as F,v as nt,c as _,_ as ut}from"./index-Bcgrj03j.js";const it={class:"automations-panel"},lt={class:"automations-toolbar"},rt={class:"automations-summary"},ct={class:"automations-actions"},dt=["title"],mt=["disabled"],pt={key:0,class:"automations-error"},vt={key:1,class:"automations-empty"},ht={key:2,class:"automations-empty"},ft={key:3,class:"automations-layout"},_t=["aria-label"],yt=["onClick","onKeydown"],bt=["data-status"],gt={class:"automation-row-main"},At={class:"automation-row-title"},Lt={class:"automation-row-meta"},Et={class:"automation-row-side"},kt=["data-status"],Ct={class:"automation-row-schedule"},wt=["onClick"],It=["aria-label"],jt={class:"automation-detail-heading"},Rt=["data-status"],Kt={class:"automation-detail-title-wrap"},Tt={class:"automation-detail-grid"},$t=["title"],Mt={class:"automation-detail-prompt"},Nt=X({__name:"AutomationsPanel",props:{groups:{},projectCwdByName:{},projectDisplayNameById:{},selectedAutomationId:{}},emits:["select-automation","edit-automation","create-automation"],setup(V,{expose:Q,emit:Y}){const h=V,E=Y,j=f({}),R=f({}),{t:s}=nt(),y=f(!1),b=f(""),d=f(h.selectedAutomationId??""),p=f(""),z=_(()=>{const t=new Map;for(const a of h.groups)for(const o of a.threads)t.set(o.id,o.title);return t}),H=_(()=>{var a,o;const t=new Map;for(const l of h.groups){const u=(a=h.projectCwdByName[l.projectName])==null?void 0:a.trim(),g=((o=h.projectDisplayNameById[l.projectName])==null?void 0:o.trim())||l.projectName;u&&t.set(u,g)}return t}),m=_(()=>{const t=[];for(const[a,o]of Object.entries(j.value)){const l=z.value.get(a)??a;for(const u of o)t.push({rowKey:M("thread",a,u.id),automation:u,scope:"thread",scopeLabel:s("Heartbeat"),targetLabel:l,targetTitle:a,scheduleLabel:N(u)})}for(const[a,o]of Object.entries(R.value)){const l=H.value.get(a)??G(a);for(const u of o)t.push({rowKey:M("project",a,u.id),automation:u,scope:"project",scopeLabel:s("Project"),targetLabel:l,targetTitle:a,scheduleLabel:N(u)})}return t.sort((a,o)=>{const l=a.automation.status==="ACTIVE"?0:1,u=o.automation.status==="ACTIVE"?0:1;if(l!==u)return l-u;const g=a.automation.createdAtMs??0,P=o.automation.createdAtMs??0;if(g!==P)return P-g;const D=a.automation.updatedAtMs??0,S=o.automation.updatedAtMs??0;return D!==S?S-D:a.automation.name.localeCompare(o.automation.name)})}),O=_(()=>m.value.filter(t=>t.automation.status==="ACTIVE").length),W=_(()=>m.value.filter(t=>t.automation.status==="PAUSED").length),r=_(()=>m.value.find(t=>t.rowKey===p.value)??m.value.find(t=>t.automation.id===d.value)??m.value[0]??null);w(()=>h.selectedAutomationId,t=>{t&&(d.value=t,p.value=$(t))}),w(d,t=>{t&&E("select-automation",t)}),w(m,t=>{if(t.length===0){d.value="",p.value="";return}if(!(p.value&&t.some(a=>a.rowKey===p.value))){if(d.value&&t.some(a=>a.automation.id===d.value)){p.value=$(d.value);return}(!d.value||!t.some(a=>a.automation.id===d.value))&&(d.value=t[0].automation.id,p.value=t[0].rowKey)}}),Z(()=>{k()}),Q({loadAutomations:k});async function k(){y.value=!0,b.value="";try{const[t,a]=await Promise.all([tt(),at()]);j.value=t,R.value=a}catch(t){b.value=t instanceof Error?t.message:s("Failed to load automations")}finally{y.value=!1}}function K(t){return s(t==="PAUSED"?"Paused":"Active")}function T(t){E("edit-automation",{scope:t.scope,target:t.targetTitle,automation:t.automation})}function J(){E("create-automation")}function C(t){p.value=t.rowKey,d.value=t.automation.id}function $(t){var a;return((a=m.value.find(o=>o.automation.id===t))==null?void 0:a.rowKey)??""}function M(t,a,o){return`${t}:${a}:${o}`}function N(t){var o,l;if(t.status==="PAUSED")return s("Paused");if(t.nextRunAtMs)return`${s("Next")} ${q(t.nextRunAtMs)}`;const a=t.rrule.trim();if(/FREQ=MINUTELY/i.test(a)){const u=((o=/INTERVAL=(\d+)/i.exec(a))==null?void 0:o[1])??"1";return u==="1"?s("Every minute"):`${s("Every")} ${u} ${s("minutes")}`}if(/FREQ=HOURLY/i.test(a)){const u=((l=/INTERVAL=(\d+)/i.exec(a))==null?void 0:l[1])??"1";return u==="1"?s("Hourly"):`${s("Every")} ${u} ${s("hours")}`}return/FREQ=DAILY/i.test(a)?s("Daily"):/FREQ=WEEKLY/i.test(a)?s("Weekly"):s("Custom schedule")}function q(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function G(t){return t.replace(/\/+$/,"").split("/").filter(Boolean).pop()??t}return(t,a)=>(c(),v("div",it,[e("div",lt,[e("div",rt,[e("span",null,n(m.value.length)+" "+n(i(s)("total")),1),e("span",null,n(O.value)+" "+n(i(s)("active")),1),e("span",null,n(W.value)+" "+n(i(s)("paused")),1)]),e("div",ct,[e("button",{class:"automations-create",type:"button",title:i(s)("Create a new automation"),onClick:J},n(i(s)("New automation")),9,dt),e("button",{class:"automations-refresh",type:"button",disabled:y.value,onClick:k},n(y.value?i(s)("Refreshing..."):i(s)("Refresh")),9,mt)])]),b.value?(c(),v("p",pt,n(b.value),1)):B("",!0),y.value&&m.value.length===0?(c(),v("div",vt,[x(A,{class:"automations-empty-icon"}),e("p",null,n(i(s)("Loading automations...")),1)])):m.value.length===0?(c(),v("div",ht,[x(A,{class:"automations-empty-icon"}),e("p",null,n(i(s)("No automations yet")),1),e("span",null,n(i(s)("Use a thread or project menu to add an automation.")),1)])):(c(),v("div",ft,[e("section",{class:"automations-list","aria-label":i(s)("Automations")},[(c(!0),v(et,null,ot(m.value,o=>(c(),v("div",{key:o.rowKey,class:st(["automation-row",{"is-selected":p.value===o.rowKey}]),role:"button",tabindex:"0",onClick:l=>C(o),onKeydown:[U(I(l=>C(o),["prevent"]),["enter"]),U(I(l=>C(o),["prevent"]),["space"])]},[e("span",{class:"automation-row-icon","data-status":o.automation.status},[o.automation.status==="PAUSED"?(c(),L(F,{key:0})):(c(),L(A,{key:1}))],8,bt),e("span",gt,[e("span",At,n(o.automation.name),1),e("span",Lt,n(o.scopeLabel)+" • "+n(o.targetLabel),1)]),e("span",Et,[e("span",{class:"automation-row-status","data-status":o.automation.status},n(K(o.automation.status)),9,kt),e("span",Ct,n(o.scheduleLabel),1)]),e("button",{class:"automation-edit-button",type:"button",onClick:I(l=>T(o),["stop"])},n(i(s)("Edit")),9,wt)],42,yt))),128))],8,_t),r.value?(c(),v("aside",{key:0,class:"automation-detail","aria-label":i(s)("Automation details")},[e("div",jt,[e("span",{class:"automation-detail-icon","data-status":r.value.automation.status},[r.value.automation.status==="PAUSED"?(c(),L(F,{key:0})):(c(),L(A,{key:1}))],8,Rt),e("div",Kt,[e("h2",null,n(r.value.automation.name),1),e("span",null,n(r.value.scopeLabel),1)]),e("button",{class:"automation-detail-edit",type:"button",onClick:a[0]||(a[0]=o=>T(r.value))},n(i(s)("Edit")),1)]),e("dl",Tt,[e("div",null,[e("dt",null,n(i(s)("Status")),1),e("dd",null,n(K(r.value.automation.status)),1)]),e("div",null,[e("dt",null,n(i(s)("Schedule")),1),e("dd",null,n(r.value.scheduleLabel),1)]),e("div",null,[e("dt",null,n(i(s)("Target")),1),e("dd",{title:r.value.targetTitle},n(r.value.targetLabel),9,$t)]),e("div",null,[a[1]||(a[1]=e("dt",null,"ID",-1)),e("dd",null,n(r.value.automation.id),1)])]),e("section",Mt,[e("h3",null,n(i(s)("Prompt")),1),e("p",null,n(r.value.automation.prompt),1)])],8,It)):B("",!0)]))]))}}),Dt=ut(Nt,[["__scopeId","data-v-3d9a9b4b"]]);export{Dt as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-Cxn_LBGD.js","assets/index.esm-Bx2Y2PLG.js","assets/index.esm-DYMAm9mq.js"])))=>i.map(i=>d[i]);
2
- import{e as be,f as l,i as o,j as s,F as T,l as B,n as Y,t as i,k as u,P as ta,u as n,w as xe,p as Oe,a1 as sa,v as lt,c as S,_ as ot,x as Ie,h as re,T as st,I as aa,r as m,H as zt,o as Yt,L as Zt,m as at,a2 as la,a3 as oa,D as Vt,B as ia,z as na,s as ra,a4 as ca,a5 as da,a6 as ua,a7 as pa,a8 as ya,a9 as ma,aa as ha,ab as va,ac as ga,ad as ba,ae as ka,af as fa,ag as $a,ah as Ca,ai as wa,aj as Sa,ak as _a,al as La,am as Pa,an as Aa,ao as Ia,ap as Ma,aq as Fa,ar as Ea,as as Ta,at as Qt,au as Ua}from"./index-rc4ZsEIH.js";import{s as Da}from"./sanitizeHtml-Bd3No2dT.js";const Na={class:"directory-section"},xa={class:"directory-toolbar"},Oa=["value"],Ra={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},Ba=["onClick"],Ga={key:0,class:"directory-empty"},Ka={key:1,class:"directory-error"},ja={key:2,class:"directory-loading"},Ha={key:3,class:"directory-empty"},qa={key:4,class:"directory-grid"},za={class:"directory-card-top"},Va=["src","alt"],Qa={class:"directory-card-main"},Wa={class:"directory-card-title-row"},Ja={class:"directory-card-title"},Ya={key:0,class:"directory-badge is-muted"},Za={key:1,class:"directory-badge"},Xa={class:"directory-card-meta"},el={key:0,class:"directory-card-description"},tl={class:"directory-chip-row"},sl={key:0,class:"directory-chip"},al={class:"directory-card-actions"},ll=["disabled","onClick"],ol=["onClick"],il=["disabled","onClick"],nl=be({__name:"DirectoryAppsTab",props:{apps:{},searchQuery:{},sortMode:{},supportsApps:{type:Boolean},error:{},isLoading:{type:Boolean},actionId:{},tryInFlightKey:{},isTryActionInFlight:{type:Boolean},appLogoSrc:{type:Function},appMetaLabel:{type:Function},appTryKey:{type:Function},toggleApp:{type:Function},openExternalUrl:{type:Function},tryApp:{type:Function},disabledLabel:{},connectedLabel:{},enableLabel:{},disableLabel:{},manageLabel:{},loginLabel:{},tryLabel:{},startingLabel:{}},emits:["update:search-query","update:sort-mode"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>(l(),o("section",Na,[s("div",xa,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps",onInput:v[0]||(v[0]=c=>f("update:search-query",c.target.value))},null,40,Oa),s("div",Ra,[(l(),o(T,null,B(M,c=>s("button",{key:c.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===c.id}]),type:"button",onClick:p=>f("update:sort-mode",c.id)},i(c.label),11,Ba)),64))])]),a.supportsApps?a.error?(l(),o("div",Ka,i(a.error),1)):a.isLoading?(l(),o("div",ja,"Loading apps...")):a.apps.length===0?(l(),o("div",Ha,"No apps found.")):(l(),o("div",qa,[(l(!0),o(T,null,B(a.apps,c=>(l(),o("article",{key:c.id,class:"directory-card"},[s("div",za,[a.appLogoSrc(c)?(l(),o("img",{key:0,class:"directory-card-icon",src:a.appLogoSrc(c),alt:c.name,loading:"lazy"},null,8,Va)):u("",!0),s("div",Qa,[s("div",Wa,[s("span",Ja,i(c.name),1),c.isEnabled?c.isAccessible?(l(),o("span",Za,i(a.connectedLabel),1)):u("",!0):(l(),o("span",Ya,i(a.disabledLabel),1))]),s("span",Xa,i(a.appMetaLabel(c)),1)])]),c.description?(l(),o("p",el,i(c.description),1)):u("",!0),s("div",tl,[c.category?(l(),o("span",sl,i(c.category),1)):u("",!0),(l(!0),o(T,null,B(c.pluginDisplayNames.slice(0,2),p=>(l(),o("span",{key:p,class:"directory-chip"},i(p),1))),128))]),s("div",al,[s("button",{class:"directory-action",type:"button",disabled:a.actionId===c.id,onClick:p=>a.toggleApp(c)},i(c.isEnabled?a.disableLabel:a.enableLabel),9,ll),c.installUrl?(l(),o("button",{key:0,class:"directory-action-link",type:"button",onClick:p=>a.openExternalUrl(c.installUrl)},i(c.isAccessible?a.manageLabel:a.loginLabel),9,ol)):u("",!0),c.isAccessible&&c.isEnabled?(l(),o("button",{key:1,class:"directory-action",type:"button",disabled:a.isTryActionInFlight,onClick:p=>a.tryApp(c)},i(a.tryInFlightKey===a.appTryKey(c)?a.startingLabel:a.tryLabel),9,il)):u("",!0)])]))),128))])):(l(),o("div",Ga," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))]))}}),rl={class:"directory-section"},cl={class:"directory-toolbar"},dl=["value"],ul={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},pl=["onClick"],yl={key:0,class:"directory-error"},ml={key:1,class:"directory-loading"},hl={key:2,class:"directory-empty"},vl={class:"directory-empty-copy"},gl={class:"directory-card-actions"},bl=["disabled"],kl={key:3,class:"composio-preview"},fl={class:"composio-preview-hero"},$l={class:"composio-preview-actions"},Cl=["disabled"],wl={class:"composio-preview-grid"},Sl={class:"directory-card-top"},_l={class:"directory-card-main"},Ll={class:"directory-card-title-row"},Pl={class:"directory-card-title"},Al={class:"directory-badge is-muted"},Il={class:"directory-card-meta"},Ml={class:"directory-card-description"},Fl={class:"directory-chip-row"},El={key:4,class:"directory-section composio-section"},Tl={class:"directory-card directory-card-wide composio-status-card"},Ul={class:"directory-card-top"},Dl={class:"directory-card-main"},Nl={class:"directory-card-title-row"},xl={class:"directory-card-title"},Ol={class:"directory-badge"},Rl={class:"directory-card-meta"},Bl={class:"directory-card-description"},Gl={class:"directory-chip-row"},Kl={key:0,class:"directory-chip"},jl={key:1,class:"directory-chip"},Hl={key:2,class:"directory-chip"},ql={class:"directory-card-actions"},zl={key:0,class:"directory-empty"},Vl={key:1,class:"directory-grid"},Ql={class:"directory-card-top"},Wl=["src","alt"],Jl={class:"directory-card-main"},Yl={class:"directory-card-title-row"},Zl={class:"directory-card-title"},Xl={key:0,class:"directory-badge"},eo={key:1,class:"directory-badge"},to={class:"directory-card-meta"},so={key:0,class:"directory-card-description"},ao={class:"directory-chip-row"},lo={class:"directory-chip"},oo={key:0,class:"directory-chip"},io={key:1,class:"directory-chip"},no={class:"directory-card-actions"},ro=["onClick"],co=["disabled","onClick"],uo=["disabled","onClick"],po={key:2,class:"directory-section-actions"},yo=["disabled"],mo=be({__name:"DirectoryComposioTab",props:{composioStatus:{},searchQuery:{},sortMode:{},error:{},isLoadingComposio:{type:Boolean},isInstallingComposio:{type:Boolean},isStartingComposioLogin:{type:Boolean},visibleComposioConnectors:{},visibleComposioPreviewConnectors:{},workspaceSummary:{},connectorCount:{},total:{},hasMoreComposioConnectors:{type:Boolean},actionSlug:{},isTryActionInFlight:{type:Boolean},tryInFlightKey:{},composioMetaLabel:{type:Function},composioPrimaryActionLabel:{type:Function},canTryComposio:{type:Function},composioTryKey:{type:Function},openComposioDetail:{type:Function},runComposioPrimaryAction:{type:Function},tryComposio:{type:Function},installComposioCli:{type:Function},startComposioCliLogin:{type:Function},loadMoreComposio:{type:Function},openExternalUrl:{type:Function},workspaceLabel:{},connectedLabel:{},authenticatedLabel:{},noAuthLabel:{},previewLabel:{},openDashboardLabel:{},detailsLabel:{},installLabel:{},installingLabel:{},loginLabel:{},openingLabel:{},startingLabel:{},tryLabel:{},loadMoreLabel:{},loadingLabel:{}},emits:["update:search-query","update:sort-mode"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>{var c;return l(),o("section",rl,[s("div",cl,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors",onInput:v[0]||(v[0]=p=>f("update:search-query",p.target.value))},null,40,dl),s("div",ul,[(l(),o(T,null,B(M,p=>s("button",{key:p.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===p.id}]),type:"button",onClick:I=>f("update:sort-mode",p.id)},i(p.label),11,pl)),64))])]),a.error?(l(),o("div",yl,i(a.error),1)):a.isLoadingComposio?(l(),o("div",ml,"Loading Composio connectors...")):(c=a.composioStatus)!=null&&c.available?a.composioStatus.authenticated?(l(),o("div",El,[s("article",Tl,[s("div",Ul,[s("div",Dl,[s("div",Nl,[s("span",xl,i(a.workspaceLabel),1),s("span",Ol,i(a.connectedLabel),1)]),s("span",Rl,i(a.composioStatus.email||a.composioStatus.defaultOrgName||a.authenticatedLabel),1)])]),s("p",Bl,i(a.workspaceSummary),1),s("div",Gl,[a.composioStatus.defaultOrgName?(l(),o("span",Kl,i(a.composioStatus.defaultOrgName),1)):u("",!0),a.composioStatus.cliVersion?(l(),o("span",jl,"CLI "+i(a.composioStatus.cliVersion),1)):u("",!0),a.connectorCount?(l(),o("span",Hl," Showing "+i(a.connectorCount)+i(a.total?` / ${a.total}`:"")+" connectors ",1)):u("",!0)]),s("div",ql,[s("button",{class:"directory-action-link",type:"button",onClick:v[4]||(v[4]=p=>a.openExternalUrl(a.composioStatus.webUrl))},i(a.openDashboardLabel),1)])]),a.visibleComposioConnectors.length===0?(l(),o("div",zl,"No Composio connectors found.")):(l(),o("div",Vl,[(l(!0),o(T,null,B(a.visibleComposioConnectors,p=>(l(),o("article",{key:p.slug,class:"directory-card"},[s("div",Ql,[p.logoUrl?(l(),o("img",{key:0,class:"directory-card-icon",src:p.logoUrl,alt:p.name,loading:"lazy"},null,8,Wl)):u("",!0),s("div",Jl,[s("div",Yl,[s("span",Zl,i(p.name),1),p.activeCount>0?(l(),o("span",Xl,i(a.connectedLabel),1)):p.isNoAuth?(l(),o("span",eo,i(a.noAuthLabel),1)):u("",!0)]),s("span",to,i(a.composioMetaLabel(p)),1)])]),p.description?(l(),o("p",so,i(p.description),1)):u("",!0),s("div",ao,[s("span",lo,i(p.toolsCount)+" tools",1),p.triggersCount>0?(l(),o("span",oo,i(p.triggersCount)+" triggers",1)):u("",!0),p.authModes.length>0?(l(),o("span",io,i(p.authModes.join(", ")),1)):u("",!0)]),s("div",no,[s("button",{class:"directory-action",type:"button",onClick:I=>a.openComposioDetail(p.slug)},i(a.detailsLabel),9,ro),a.composioPrimaryActionLabel(p)?(l(),o("button",{key:0,class:"directory-action-link",type:"button",disabled:a.actionSlug===p.slug,onClick:I=>a.runComposioPrimaryAction(p)},i(a.actionSlug===p.slug?a.openingLabel:a.composioPrimaryActionLabel(p)),9,co)):u("",!0),a.canTryComposio(p)?(l(),o("button",{key:1,class:"directory-action primary",type:"button",disabled:a.isTryActionInFlight,onClick:I=>a.tryComposio(p)},i(a.tryInFlightKey===a.composioTryKey(p.slug)?a.startingLabel:a.tryLabel),9,uo)):u("",!0)])]))),128))])),a.hasMoreComposioConnectors?(l(),o("div",po,[s("button",{class:"directory-action",type:"button",disabled:a.isLoadingComposio,onClick:v[5]||(v[5]=(...p)=>a.loadMoreComposio&&a.loadMoreComposio(...p))},i(a.isLoadingComposio?a.loadingLabel:a.loadMoreLabel),9,yo)])):u("",!0)])):(l(),o("div",kl,[s("article",fl,[v[7]||(v[7]=s("div",{class:"composio-preview-copy"},[s("div",null,[s("p",{class:"composio-preview-kicker"},"Connector catalog preview"),s("h3",{class:"composio-preview-title"},"Connect everyday apps like Gmail, Calendar, Reddit, YouTube, and Drive."),s("p",{class:"composio-preview-text"}," Composio is installed locally. Login to browse the live catalog, connect your accounts, and try simple actions from this machine. ")])],-1)),s("div",$l,[s("button",{class:"directory-action primary",type:"button",disabled:a.isStartingComposioLogin,onClick:v[2]||(v[2]=(...p)=>a.startComposioCliLogin&&a.startComposioCliLogin(...p))},i(a.isStartingComposioLogin?a.openingLabel:a.loginLabel),9,Cl),s("button",{class:"directory-action-link",type:"button",onClick:v[3]||(v[3]=p=>a.openExternalUrl(a.composioStatus.webUrl||"https://dashboard.composio.dev/"))},i(a.openDashboardLabel),1)])]),s("div",wl,[(l(!0),o(T,null,B(a.visibleComposioPreviewConnectors,p=>(l(),o("article",{key:p.slug,class:"directory-card composio-preview-card"},[s("div",Sl,[s("div",_l,[s("div",Ll,[s("span",Pl,i(p.name),1),s("span",Al,i(a.previewLabel),1)]),s("span",Il,i(p.meta),1)])]),s("p",Ml,i(p.description),1),s("div",Fl,[(l(!0),o(T,null,B(p.chips,I=>(l(),o("span",{key:I,class:"directory-chip"},i(I),1))),128))])]))),128))])])):(l(),o("div",hl,[s("div",vl,[v[6]||(v[6]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",gl,[s("button",{class:"directory-action primary",type:"button",disabled:a.isInstallingComposio,onClick:v[1]||(v[1]=(...p)=>a.installComposioCli&&a.installComposioCli(...p))},i(a.isInstallingComposio?a.installingLabel:a.installLabel),9,bl)])])]))])}}}),ho={class:"directory-section"},vo={class:"directory-toolbar"},go=["value"],bo={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},ko=["onClick"],fo={key:0,class:"directory-marketplace"},$o={class:"directory-marketplace-header"},Co=["disabled"],wo={key:0,class:"directory-marketplace-empty"},So={key:1,class:"directory-marketplace-list"},_o={class:"directory-marketplace-name"},Lo={key:0,class:"directory-marketplace-path"},Po=["disabled","onClick"],Ao={class:"directory-marketplace-add"},Io=["value"],Mo=["disabled"],Fo={key:1,class:"directory-empty"},Eo={key:2,class:"directory-error"},To={key:3,class:"directory-loading"},Uo={key:4,class:"directory-empty"},Do={key:5,class:"directory-grid"},No=["onClick"],xo={class:"directory-card-top"},Oo=["src","alt"],Ro={class:"directory-card-main"},Bo={class:"directory-card-title-row"},Go={class:"directory-card-title"},Ko={key:0,class:"directory-badge is-muted"},jo={key:1,class:"directory-badge"},Ho={class:"directory-card-meta"},qo={key:0,class:"directory-card-description"},zo={class:"directory-chip-row"},Vo={key:0,class:"directory-chip"},Qo=be({__name:"DirectoryPluginsTab",props:{plugins:{},searchQuery:{},sortMode:{},supportsPlugins:{type:Boolean},supportsMarketplace:{type:Boolean},error:{},isLoading:{type:Boolean},marketplaces:{},marketplaceSourceUrl:{},marketplaceActionName:{},isMarketplaceActionInFlight:{type:Boolean},pluginIconSrc:{type:Function},openPluginDetail:{type:Function},addMarketplace:{type:Function},removeMarketplace:{type:Function},upgradeAllMarketplaces:{type:Function},disabledLabel:{},installedLabel:{},pluginLabel:{},upgradeAllLabel:{},upgradingLabel:{},removingLabel:{},removeLabel:{},addingLabel:{},addLabel:{}},emits:["update:search-query","update:sort-mode","update:marketplace-source-url"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>(l(),o("section",ho,[s("div",vo,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins",onInput:v[0]||(v[0]=c=>f("update:search-query",c.target.value))},null,40,go),s("div",bo,[(l(),o(T,null,B(M,c=>s("button",{key:c.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===c.id}]),type:"button",onClick:p=>f("update:sort-mode",c.id)},i(c.label),11,ko)),64))])]),a.supportsMarketplace?(l(),o("div",fo,[s("div",$o,[v[5]||(v[5]=s("span",{class:"directory-marketplace-title"},"Marketplaces",-1)),s("button",{class:"directory-marketplace-upgrade",type:"button",disabled:a.isMarketplaceActionInFlight,onClick:v[1]||(v[1]=(...c)=>a.upgradeAllMarketplaces&&a.upgradeAllMarketplaces(...c))},i(a.marketplaceActionName==="upgrade"?a.upgradingLabel:a.upgradeAllLabel),9,Co)]),a.marketplaces.length===0?(l(),o("div",wo,"No marketplaces configured.")):(l(),o("div",So,[(l(!0),o(T,null,B(a.marketplaces,c=>(l(),o("div",{key:c.name,class:"directory-marketplace-row"},[s("span",_o,i(c.displayName),1),c.path?(l(),o("code",Lo,i(c.path),1)):u("",!0),s("button",{class:"directory-marketplace-remove",type:"button",disabled:a.isMarketplaceActionInFlight,onClick:p=>a.removeMarketplace(c.name)},i(a.marketplaceActionName===`remove:${c.name}`?a.removingLabel:a.removeLabel),9,Po)]))),128))])),s("div",Ao,[s("input",{value:a.marketplaceSourceUrl,class:"directory-marketplace-source",type:"url",placeholder:"Git URL to add a marketplace","aria-label":"Marketplace Git URL",onInput:v[2]||(v[2]=c=>f("update:marketplace-source-url",c.target.value)),onKeydown:v[3]||(v[3]=ta((...c)=>a.addMarketplace&&a.addMarketplace(...c),["enter"]))},null,40,Io),s("button",{class:"directory-marketplace-add-button",type:"button",disabled:a.isMarketplaceActionInFlight||!a.marketplaceSourceUrl.trim(),onClick:v[4]||(v[4]=(...c)=>a.addMarketplace&&a.addMarketplace(...c))},i(a.marketplaceActionName==="add"?a.addingLabel:a.addLabel),9,Mo)])])):u("",!0),a.supportsPlugins?a.error?(l(),o("div",Eo,i(a.error),1)):a.isLoading?(l(),o("div",To,"Loading plugins...")):a.plugins.length===0?(l(),o("div",Uo,"No plugins found.")):(l(),o("div",Do,[(l(!0),o(T,null,B(a.plugins,c=>(l(),o("button",{key:c.id,class:Y(["directory-card",{"is-disabled":c.installed&&!c.enabled}]),type:"button",onClick:p=>a.openPluginDetail(c)},[s("div",xo,[a.pluginIconSrc(c)?(l(),o("img",{key:0,class:"directory-card-icon",src:a.pluginIconSrc(c),alt:c.displayName,loading:"lazy"},null,8,Oo)):u("",!0),s("div",Ro,[s("div",Bo,[s("span",Go,i(c.displayName),1),c.installed&&!c.enabled?(l(),o("span",Ko,i(a.disabledLabel),1)):c.installed?(l(),o("span",jo,i(a.installedLabel),1)):u("",!0)]),s("span",Ho,i(c.developerName||c.marketplaceDisplayName||c.marketplaceName||a.pluginLabel),1)])]),c.description?(l(),o("p",qo,i(c.description),1)):u("",!0),s("div",zo,[c.category?(l(),o("span",Vo,i(c.category),1)):u("",!0),(l(!0),o(T,null,B(c.capabilities.slice(0,2),p=>(l(),o("span",{key:p,class:"directory-chip"},i(p),1))),128))])],10,No))),128))])):(l(),o("div",Fo," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))]))}}),Wo={class:"skill-card-top"},Jo=["src","alt"],Yo={class:"skill-card-info"},Zo={class:"skill-card-header"},Xo={class:"skill-card-name"},ei={key:0,class:"skill-card-badge-disabled"},ti={key:1,class:"skill-card-badge"},si={key:0,class:"skill-card-owner"},ai=["title"],li={key:0,class:"skill-card-desc"},oi={key:1,class:"skill-card-meta-row"},ii=be({__name:"SkillCard",props:{skill:{},showStatusBadge:{type:Boolean,default:!0},showBrowseAction:{type:Boolean,default:!0},showOwner:{type:Boolean,default:!0}},emits:["select"],setup(a){const N=a,{t:f}=lt(),M=S(()=>N.showStatusBadge!==!1),_=S(()=>N.showBrowseAction!==!1),v=S(()=>N.showOwner!==!1),c=S(()=>{const r=N.skill.path;return r?r.endsWith("/SKILL.md")?r.slice(0,-9):r:""});function p(){const r=c.value;r&&window.open(`/codex-local-browse${encodeURI(r)}`,"_blank","noopener,noreferrer")}const I=S(()=>{const r=N.skill.publishedAt;if(!r)return"";const G=new Date(r),z=Date.now()-r;return z<36e5?`${Math.floor(z/6e4)}${f("ago")}`:z<864e5?`${Math.floor(z/36e5)}${f("ago")}`:z<2592e6?`${Math.floor(z/864e5)}${f("ago")}`:G.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),x=S(()=>{const r=[];return N.skill.installCountLabel&&r.push(N.skill.installCountLabel),I.value&&r.push(I.value),r});function H(r){const G=r.target;G.style.display="none"}return(r,G)=>(l(),o("button",{class:Y(["skill-card",{"is-disabled":a.skill.installed&&a.skill.enabled===!1}]),type:"button",onClick:G[0]||(G[0]=q=>r.$emit("select",a.skill))},[s("div",Wo,[a.skill.avatarUrl?(l(),o("img",{key:0,class:"skill-card-avatar",src:a.skill.avatarUrl,alt:a.skill.owner,loading:"lazy",onError:H},null,40,Jo)):u("",!0),s("div",Yo,[s("div",Zo,[s("span",Xo,i(a.skill.displayName||a.skill.name),1),M.value?(l(),o(T,{key:0},[a.skill.installed&&a.skill.enabled===!1?(l(),o("span",ei,i(n(f)("Disabled")),1)):a.skill.installed?(l(),o("span",ti,i(n(f)("Installed")),1)):u("",!0)],64)):u("",!0)]),v.value?(l(),o("span",si,i(a.skill.owner),1)):u("",!0)]),_.value&&a.skill.installed&&c.value?(l(),o("button",{key:1,class:"skill-card-browse",type:"button",title:n(f)("Browse files"),onClick:xe(p,["stop"])},[Oe(sa,{class:"skill-card-browse-icon"})],8,ai)):u("",!0)]),a.skill.description?(l(),o("p",li,i(a.skill.description),1)):u("",!0),x.value.length>0?(l(),o("div",oi,[(l(!0),o(T,null,B(x.value,q=>(l(),o("span",{key:q,class:"skill-card-meta"},i(q),1))),128))])):u("",!0)],2))}}),Wt=ot(ii,[["__scopeId","data-v-cb7845c3"]]),ni={class:"sdm-panel"},ri={class:"sdm-header"},ci={class:"sdm-title-area"},di=["src","alt"],ui={class:"sdm-title-col"},pi={class:"sdm-title-row"},yi={class:"sdm-title"},mi={key:0,class:"sdm-badge-disabled"},hi={class:"sdm-owner"},vi=["aria-label"],gi={class:"sdm-body"},bi={key:0,class:"sdm-desc"},ki={key:1,class:"sdm-readme-loading"},fi=["innerHTML"],$i=["href"],Ci={class:"sdm-footer"},wi={class:"sdm-footer-actions"},Si=["disabled"],_i=["disabled"],Li=["disabled"],Pi=["disabled"],Ai=be({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(a,{emit:N}){const f=a,M=N,_=m(null),v=m(""),c=m(""),p=m(!1),{t:I}=lt(),x=S(()=>_.value??f.skill.enabled??!0),H=S(()=>f.isInstalling===!0||f.isUninstalling===!0),r=S(()=>v.value||f.skill.description),G=S(()=>{const A=f.skill.path;return A?A.endsWith("/SKILL.md")?A.slice(0,-9):A:""}),q=S(()=>{const A=c.value;if(!A)return"";const D=A.replace(/^---[\s\S]*?---\s*/,"");return Da(z(D))});function z(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function te(){if(!(!f.skill.owner||!f.skill.name)){p.value=!0,v.value="",c.value="";try{const A=new URLSearchParams({owner:f.skill.owner,name:f.skill.name});f.skill.installed&&A.set("installed","true"),f.skill.path&&A.set("path",f.skill.path);const D=await fetch(`/codex-api/skills-hub/readme?${A}`);if(!D.ok)return;const K=await D.json();c.value=K.content??"",v.value=K.description??""}catch{}finally{p.value=!1}}}Ie(()=>f.visible,A=>{A&&(_.value=null,v.value="",c.value="",te())});function F(){M("install",f.skill)}function $(){M("uninstall",f.skill)}function w(){const A=!x.value;_.value=A,M("toggle-enabled",f.skill,A)}function k(){f.isTrying||M("try",f.skill)}function V(){const A=G.value;A&&window.open(`/codex-local-browse${encodeURI(A)}`,"_blank","noopener,noreferrer")}return(A,D)=>(l(),re(st,{to:"body"},[a.visible?(l(),o("div",{key:0,class:"sdm-overlay",onClick:D[1]||(D[1]=xe(K=>A.$emit("close"),["self"]))},[s("div",ni,[s("div",ri,[s("div",ci,[a.skill.avatarUrl?(l(),o("img",{key:0,class:"sdm-avatar",src:a.skill.avatarUrl,alt:a.skill.owner,loading:"lazy"},null,8,di)):u("",!0),s("div",ui,[s("div",pi,[s("h3",yi,i(a.skill.displayName||a.skill.name),1),a.skill.installed&&!x.value?(l(),o("span",mi,i(n(I)("Disabled")),1)):u("",!0)]),s("span",hi,i(a.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":n(I)("Close"),onClick:D[0]||(D[0]=K=>A.$emit("close"))},[Oe(aa,{class:"sdm-close-icon"})],8,vi)]),s("div",gi,[r.value?(l(),o("p",bi,i(r.value),1)):u("",!0),p.value?(l(),o("div",ki,i(n(I)("Loading skill contents...")),1)):c.value?(l(),o("div",{key:2,class:"sdm-readme",innerHTML:q.value},null,8,fi)):u("",!0),a.skill.url?(l(),o("a",{key:3,class:"sdm-link",href:a.skill.url,target:"_blank",rel:"noopener noreferrer"},i(n(I)("View on GitHub")),9,$i)):u("",!0)]),s("div",Ci,[s("div",wi,[a.skill.installed?(l(),o("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:H.value,onClick:$},i(f.isUninstalling?n(I)("Uninstalling..."):n(I)("Uninstall")),9,Si)):(l(),o("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:H.value,onClick:F},i(f.isInstalling?n(I)("Installing..."):n(I)("Install")),9,_i)),a.skill.installed?(l(),o("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:H.value,onClick:w},i(x.value?n(I)("Disable"):n(I)("Enable")),9,Li)):u("",!0),a.skill.installed&&x.value?(l(),o("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:H.value||f.isTrying,onClick:k},i(f.isTrying?"Starting...":"Try it!"),9,Pi)):u("",!0),a.skill.installed&&G.value?(l(),o("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:V},i(n(I)("Browse files")),1)):u("",!0)])])])])):u("",!0)]))}}),Ii=ot(Ai,[["__scopeId","data-v-149eac3d"]]),Mi={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};let mt=null;function Fi(){return mt||(mt=Promise.all([zt(()=>import("./index.esm-Cxn_LBGD.js"),__vite__mapDeps([0,1])),zt(()=>import("./index.esm-DYMAm9mq.js"),__vite__mapDeps([2,1]))])),mt}function Ei(a){const N=m(null),f=m(""),M=m(""),_=m(""),v=m({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),c=S(()=>_.value==="pull"),p=S(()=>_.value==="push"),I=S(()=>_.value==="startup-sync"),x=S(()=>_.value!=="");async function H(){try{const $=await fetch("/codex-api/skills-sync/status");if(!$.ok)return;const w=await $.json();w.data&&(v.value=w.data)}catch{}}async function r(){try{const $=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),w=await $.json();if(!$.ok||!w.data)throw new Error("Failed to start GitHub login");N.value=w.data;const k=30,V=Math.max((w.data.interval??5)*1e3,3e3);let A=!1;for(let D=0;D<k;D++){await new Promise(X=>setTimeout(X,V));const K=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:w.data.device_code})}),Q=await K.json();if(!K.ok)throw new Error(Q.error||"Failed to complete GitHub login");if(Q.ok){A=!0;break}if(!Q.pending)throw new Error(Q.error||"Failed to complete GitHub login")}if(!A)throw new Error("GitHub login timed out. Please retry.");N.value=null,await H(),a.showToast("GitHub login successful")}catch($){a.showToast($ instanceof Error?$.message:"Failed GitHub login","error")}}async function G(){try{const[$,w]=await Fi(),{getApp:k,getApps:V,initializeApp:A}=$,{getAuth:D,GithubAuthProvider:K,signInWithPopup:Q}=w,X=V().length>0?k():A(Mi),me=D(X),se=new K;se.addScope("repo");const ke=await Q(me,se),ae=K.credentialFromResult(ke),le=(ae==null?void 0:ae.accessToken)??"";if(!le)throw new Error("GitHub access token missing from Firebase login");const Z=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:le})}),W=await Z.json();if(!Z.ok||!W.ok)throw new Error(W.error||"Failed to login with GitHub token");await H(),a.showToast("GitHub login successful")}catch($){const w=$ instanceof Error?$.message:"Failed Firebase GitHub login";a.showToast(w,"error")}}async function q(){M.value="",f.value="pull-started",_.value="pull";try{const $=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to pull synced skills");await a.onPulled(),f.value="pull-success",a.showToast(v.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch($){const w=$ instanceof Error?$.message:"Failed to pull sync";M.value=w,f.value="pull-failed",a.showToast(w,"error")}finally{_.value=""}}async function z(){M.value="",f.value="push-started",_.value="push";try{const $=await fetch("/codex-api/skills-sync/push",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to push synced skills");f.value="push-success",a.showToast("Pushed skills to private sync repo")}catch($){const w=$ instanceof Error?$.message:"Failed to push sync";M.value=w,f.value="push-failed",a.showToast(w,"error")}finally{_.value=""}}async function te(){M.value="",f.value="startup-sync-started",_.value="startup-sync";try{const $=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to run startup sync");await a.onPulled(),await H(),f.value="startup-sync-success",a.showToast("Startup sync completed")}catch($){const w=$ instanceof Error?$.message:"Failed startup sync";M.value=w,f.value="startup-sync-failed",a.showToast(w,"error")}finally{_.value=""}}async function F(){try{const $=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to logout GitHub");await H(),a.showToast("Logged out from GitHub")}catch($){a.showToast($ instanceof Error?$.message:"Failed to logout GitHub","error")}}return{deviceLogin:N,isPullInFlight:c,isPushInFlight:p,isStartupSyncInFlight:I,isSyncActionInFlight:x,loadSyncStatus:H,logoutGithub:F,pullSkillsSync:q,pushSkillsSync:z,startupSkillsSync:te,startGithubFirebaseLogin:G,startGithubLogin:r,syncActionError:M,syncActionStatus:f,syncStatus:v}}const Ti={class:"skills-hub"},Ui={class:"skills-hub-header"},Di={class:"skills-hub-title"},Ni={class:"skills-hub-subtitle"},xi={class:"skills-sync-panel"},Oi={class:"skills-sync-header"},Ri=["href"],Bi={key:1,class:"skills-sync-badge"},Gi={key:2,class:"skills-sync-badge"},Ki={class:"skills-sync-meta"},ji={key:0,class:"skills-sync-error"},Hi=["href"],qi={key:1,class:"skills-sync-meta"},zi={key:2,class:"skills-sync-error"},Vi=["href"],Qi={key:3,class:"skills-sync-device"},Wi=["href"],Ji={class:"skills-sync-actions"},Yi=["disabled"],Zi=["disabled"],Xi=["disabled"],en=["disabled"],tn={class:"skills-search-panel"},sn={class:"skills-search-header"},an={class:"skills-search-copy"},ln={class:"skills-directory-link",href:"https://skills.anyclaw.store/",target:"_blank",rel:"noopener noreferrer"},on=["placeholder","aria-label"],nn=["disabled"],rn={key:0,class:"skills-hub-error"},cn=["href"],dn={key:1,class:"skills-hub-section"},un={class:"skills-hub-section-title"},pn={key:0,class:"skills-hub-grid"},yn={key:2,class:"skills-hub-section"},mn={class:"skills-hub-section-title"},hn={key:0,class:"skills-hub-grid"},vn={class:"skills-hub-section"},gn={key:0,class:"skills-hub-loading"},bn={key:1,class:"skills-hub-error"},kn=["href"],fn={key:2,class:"skills-hub-empty"},$n=be({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(a,{emit:N}){const f={name:"",owner:"",description:"",url:"",installed:!1},M=m([]),_=m([]),v=m(!1),c=m(!1),p=m(""),I=m(""),x=m(""),H=m(!0),r=m(!0),G=m(!1),q=m(f),z=m(null),te=m(""),F=m(!1),$=m(!1);let w=null;Yt(()=>{w&&clearTimeout(w)});const{t:k}=lt(),{buildFeedbackMailto:V,feedbackMailtoBase:A,recordVisibleFailure:D}=na(),K=A(),Q=a,X=N,me=S(()=>{var g;return((g=z.value)==null?void 0:g.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),se=S(()=>`${q.value.owner}/${q.value.name}`),ke=S(()=>F.value&&te.value===se.value),ae=S(()=>$.value&&te.value===se.value),le=S(()=>{if(!O.value.configured)return"";const g=O.value.repoOwner.trim(),h=O.value.repoName.trim();return!g||!h?"":`https://github.com/${encodeURIComponent(g)}/${encodeURIComponent(h)}`}),Z=S(()=>M.value);function W(g,h="success"){z.value={text:g,type:h},w&&clearTimeout(w),w=setTimeout(()=>{z.value=null},3e3)}function he(g,h){D(h);const b=g.currentTarget;b instanceof HTMLAnchorElement&&(b.href=V())}function fe(g){if(M.value=g.installed??[],_.value.length>0){const h=new Map(M.value.map(b=>[b.name,b]));_.value=_.value.map(b=>{const R=h.get(b.name);return R?Me(b,R):b})}}function Me(g,h){return{...g,installed:!0,path:h.path,enabled:h.enabled}}function Re(g,h){return{...g,installed:!0,source:h.source,publishedAt:h.publishedAt}}async function ce(){v.value=!0,p.value="";try{const g=await fetch("/codex-api/skills-hub");if(!g.ok)throw new Error(`HTTP ${g.status}`);const h=await g.json();fe(h)}catch(g){p.value=g instanceof Error?g.message:k("Failed to load skills")}finally{v.value=!1}}function Fe(g){const h=g.installed?M.value.find(b=>b.name===g.name):void 0;q.value=h?Re(h,g):g,G.value=!0}async function Be(){const g=I.value.trim();if(!(g.length<2)){c.value=!0,x.value="";try{const h=new URLSearchParams({q:g}),b=await fetch(`/codex-api/skills-hub/search?${h}`),R=await b.json();if(!b.ok)throw new Error(R.error||`HTTP ${b.status}`);const oe=new Map(M.value.map(ie=>[ie.name,ie]));_.value=(R.results??[]).map(ie=>{const ee=oe.get(ie.name);return ee?Me(ie,ee):ie}),r.value=!0,_.value.length===0&&W(k("No matching skills found."),"error")}catch(h){x.value=h instanceof Error?h.message:k("Failed to search skills")}finally{c.value=!1}}}async function Ge(g){te.value=`${g.owner}/${g.name}`,F.value=!0;try{const b=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:g.owner,name:g.name,source:g.source})})).json();if(!b.ok)throw new Error(b.error||k("Install failed"));if(!b.path)throw new Error(k("Install completed but no local skill path was returned"));await ce();const R=M.value.find(oe=>oe.name===g.name);if(!(R!=null&&R.path))throw new Error(k("Install completed but the local skill was not found after refresh"));q.value=Re(R,g),W(`${g.displayName||g.name} ${k("skill installed")}`),G.value=!1,X("skills-changed")}catch(h){W(h instanceof Error?h.message:k("Failed to install skill"),"error")}finally{F.value=!1}}async function Ke(g){te.value=`${g.owner}/${g.name}`,$.value=!0;try{const b=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g.name,path:g.path})})).json();if(!b.ok)throw new Error(b.error||k("Uninstall failed"));M.value=M.value.filter(R=>R.name!==g.name),W(`${g.displayName||g.name} ${k("skill uninstalled")}`),G.value=!1,X("skills-changed")}catch(h){W(h instanceof Error?h.message:k("Failed to uninstall skill"),"error")}finally{$.value=!1}}async function je(g,h){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:g.path,enabled:h}})})).ok)throw new Error(k("Failed to update skill"));await fetch("/codex-api/skills-sync/push",{method:"POST"}),W(`${g.displayName||g.name} ${k("skill")} ${k(h?"enabled":"disabled")}`),await ce()}catch(b){W(b instanceof Error?b.message:k("Failed to update skill"),"error")}}function L(g){!g.installed||g.enabled===!1||Q.tryInFlightKey||(X("try-item",{kind:"skill",name:g.name,displayName:g.displayName||g.name,skillPath:g.path}),G.value=!1)}function U(g){return`skill:${g.name}:${g.path??""}`}const{deviceLogin:$e,isPullInFlight:He,isPushInFlight:Ee,isStartupSyncInFlight:P,isSyncActionInFlight:de,loadSyncStatus:qe,logoutGithub:Ce,pullSkillsSync:Te,pushSkillsSync:Ue,startupSkillsSync:J,startGithubFirebaseLogin:De,startGithubLogin:ve,syncActionError:ue,syncActionStatus:we,syncStatus:O}=Ei({showToast:W,onPulled:async()=>{await ce(),X("skills-changed")}}),Se=[S(()=>O.value.startup.lastError),ue,x,p];return Zt(()=>{ce(),qe()}),Ie(Se,(g,h)=>{g.forEach((b,R)=>{if(b===h[R])return;const oe=b.trim();oe&&D(oe)})}),(g,h)=>(l(),o("div",Ti,[s("div",Ui,[s("h2",Di,i(n(k)("Skills Hub")),1),s("p",Ni,i(n(k)("Manage installed skills on this machine")),1)]),s("div",xi,[s("div",Oi,[s("strong",null,i(n(k)("Skills Sync (GitHub)")),1),n(O).configured&&le.value?(l(),o("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:le.value,target:"_blank",rel:"noopener noreferrer"},i(n(k)("Connected"))+": "+i(n(O).repoOwner)+"/"+i(n(O).repoName),9,Ri)):n(O).loggedIn?(l(),o("span",Bi,i(n(k)("Logged in as"))+" "+i(n(O).githubUsername),1)):(l(),o("span",Gi,i(n(k)("Not connected")),1))]),s("div",Ki,[s("span",null,i(n(k)("Startup"))+": "+i(n(O).startup.mode),1),s("span",null,i(n(k)("Branch"))+": "+i(n(O).startup.branch),1),s("span",null,i(n(k)("Action"))+": "+i(n(O).startup.lastAction),1)]),n(O).startup.lastError?(l(),o("div",ji,[s("span",null,i(n(O).startup.lastError),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[0]||(h[0]=b=>he(b,n(O).startup.lastError))},i(n(k)("Send feedback")),9,Hi)])):u("",!0),n(we)?(l(),o("div",qi,[s("span",null,i(n(k)("Manual sync"))+": "+i(n(we)),1)])):u("",!0),n(ue)?(l(),o("div",zi,[s("span",null,i(n(ue)),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[1]||(h[1]=b=>he(b,n(ue)))},i(n(k)("Send feedback")),9,Vi)])):u("",!0),n($e)?(l(),o("div",Qi,[s("span",null,[at(i(n(k)("Open"))+" ",1),s("a",{href:n($e).verification_uri,target:"_blank",rel:"noreferrer"},i(n(k)("GitHub device login")),9,Wi),at(" "+i(n(k)("and enter code:")),1)]),s("code",null,i(n($e).user_code),1)])):u("",!0),s("div",Ji,[n(O).loggedIn?u("",!0):(l(),o("button",{key:0,class:"skills-hub-sort",type:"button",onClick:h[2]||(h[2]=(...b)=>n(De)&&n(De)(...b))},i(n(k)("Login with GitHub")),1)),n(O).loggedIn?u("",!0):(l(),o("button",{key:1,class:"skills-hub-sort",type:"button",onClick:h[3]||(h[3]=(...b)=>n(ve)&&n(ve)(...b))},i(n(k)("Device Login")),1)),n(O).loggedIn?(l(),o("button",{key:2,class:"skills-hub-sort",type:"button",onClick:h[4]||(h[4]=(...b)=>n(Ce)&&n(Ce)(...b)),disabled:n(de)},i(n(k)("Logout GitHub")),9,Yi)):u("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:h[5]||(h[5]=(...b)=>n(J)&&n(J)(...b)),disabled:n(de)},i(n(P)?n(k)("Syncing..."):n(k)("Startup Sync")),9,Zi),s("button",{class:"skills-hub-sort",type:"button",onClick:h[6]||(h[6]=(...b)=>n(Te)&&n(Te)(...b)),disabled:n(de)},i(n(He)?n(k)("Pulling..."):n(k)("Pull")),9,Xi),n(O).loggedIn?(l(),o("button",{key:3,class:"skills-hub-sort",type:"button",onClick:h[7]||(h[7]=(...b)=>n(Ue)&&n(Ue)(...b)),disabled:!n(O).configured||n(de)},i(n(Ee)?n(k)("Pushing..."):n(k)("Push")),9,en)):u("",!0)])]),z.value?(l(),o("div",{key:0,class:Y(["skills-hub-toast",me.value])},i(z.value.text),3)):u("",!0),s("div",tn,[s("div",sn,[s("div",an,[s("strong",null,i(n(k)("Find skills")),1),s("span",null,i(n(k)("Search the Skills registry with npx skills find.")),1)]),s("a",ln,i(n(k)("Skills directory")),1)]),s("form",{class:"skills-search-form",onSubmit:xe(Be,["prevent"])},[la(s("input",{"onUpdate:modelValue":h[8]||(h[8]=b=>I.value=b),class:"skills-search-input",type:"search",placeholder:n(k)("Search skills..."),"aria-label":n(k)("Search skills")},null,8,on),[[oa,I.value]]),s("button",{class:"skills-hub-sort",type:"submit",disabled:c.value||I.value.trim().length<2},i(c.value?n(k)("Searching..."):n(k)("Search")),9,nn)],32),x.value?(l(),o("div",rn,[s("span",null,i(x.value),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[9]||(h[9]=b=>he(b,x.value))},i(n(k)("Send feedback")),9,cn)])):u("",!0)]),_.value.length>0?(l(),o("div",dn,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:h[10]||(h[10]=b=>r.value=!r.value)},[s("span",un,i(n(k)("Search results ({count})",{count:_.value.length})),1),Oe(Vt,{class:Y(["skills-hub-section-chevron",{"is-open":r.value}])},null,8,["class"])]),r.value?(l(),o("div",pn,[(l(!0),o(T,null,B(_.value,b=>(l(),re(Wt,{key:b.source||`${b.owner}/${b.name}`,skill:b,"show-browse-action":!1,onSelect:R=>Fe(R)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),ia(g.$slots,"before-installed",{},void 0),Z.value.length>0?(l(),o("div",yn,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:h[11]||(h[11]=b=>H.value=!H.value)},[s("span",mn,i(n(k)("Installed skills ({count})",{count:Z.value.length})),1),Oe(Vt,{class:Y(["skills-hub-section-chevron",{"is-open":H.value}])},null,8,["class"])]),H.value?(l(),o("div",hn,[(l(!0),o(T,null,B(Z.value,b=>(l(),re(Wt,{key:b.name,skill:b,"show-status-badge":!1,"show-owner":!1,onSelect:R=>Fe(R)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),s("div",vn,[v.value?(l(),o("div",gn,i(n(k)("Loading skills...")),1)):p.value?(l(),o("div",bn,[s("span",null,i(p.value),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[12]||(h[12]=b=>he(b,p.value))},i(n(k)("Send feedback")),9,kn)])):M.value.length===0?(l(),o("div",fn,i(n(k)("No installed skills found.")),1)):u("",!0)]),Oe(Ii,{skill:q.value,visible:G.value,"is-installing":ke.value,"is-uninstalling":ae.value,"is-trying":Q.tryInFlightKey===U(q.value),onClose:h[13]||(h[13]=b=>G.value=!1),onInstall:Ge,onUninstall:Ke,onToggleEnabled:je,onTry:L},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),Cn=ot($n,[["__scopeId","data-v-513a5347"]]),wn={class:"directory-section"},Sn={class:"skills-embedded-section"},_n={class:"skills-embedded-title"},Ln={key:0,class:"skills-embedded-body"},Pn={key:0,class:"directory-empty"},An={key:1,class:"directory-error"},In={key:2,class:"directory-loading"},Mn={key:3,class:"directory-empty"},Fn={key:4,class:"mcp-skill-grid"},En=["onClick"],Tn={class:"mcp-skill-card-top"},Un={class:"mcp-skill-info"},Dn={class:"mcp-skill-header"},Nn={class:"mcp-skill-name"},xn={class:"mcp-skill-meta"},On={key:0,class:"directory-mcp-detail"},Rn={key:0},Bn={class:"directory-mini-list"},Gn={key:1},Kn={class:"directory-mini-list"},jn=be({__name:"DirectorySkillsTab",props:{tryInFlightKey:{},supportsMcps:{type:Boolean},mcpError:{},isLoadingMcps:{type:Boolean},visibleMcpServers:{},isMcpSectionOpen:{type:Boolean},expandedMcpNames:{},formatMcpAuthStatus:{type:Function},mcpCardBadgeClass:{type:Function},toggleMcpSectionOpen:{type:Function},toggleMcpExpanded:{type:Function}},emits:["skills-changed","try-item"],setup(a,{emit:N}){const f=N;return(M,_)=>(l(),o("section",wn,[Oe(Cn,{"try-in-flight-key":a.tryInFlightKey,onSkillsChanged:_[1]||(_[1]=v=>f("skills-changed")),onTryItem:_[2]||(_[2]=v=>f("try-item",v))},{"before-installed":ra(()=>[s("div",Sn,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:_[0]||(_[0]=(...v)=>a.toggleMcpSectionOpen&&a.toggleMcpSectionOpen(...v))},[s("span",_n,"MCPs("+i(a.visibleMcpServers.length)+")",1),s("span",{class:Y(["skills-embedded-chevron",{"is-open":a.isMcpSectionOpen}])},"›",2)]),a.isMcpSectionOpen?(l(),o("div",Ln,[a.supportsMcps?a.mcpError?(l(),o("div",An,i(a.mcpError),1)):a.isLoadingMcps?(l(),o("div",In,"Loading MCP servers...")):a.visibleMcpServers.length===0?(l(),o("div",Mn,"No MCP servers configured.")):(l(),o("div",Fn,[(l(!0),o(T,null,B(a.visibleMcpServers,v=>(l(),o("article",{key:v.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:c=>a.toggleMcpExpanded(v.name)},[s("div",Tn,[s("div",Un,[s("div",Dn,[s("span",Nn,i(v.name),1),s("span",{class:Y(["mcp-skill-badge",a.mcpCardBadgeClass(v.authStatus)])},i(a.formatMcpAuthStatus(v.name)),3)]),_[3]||(_[3]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:Y(["mcp-skill-chevron",{"is-open":a.expandedMcpNames.has(v.name)}])},"›",2)]),s("p",xn,i(v.tools.length)+" tools · "+i(v.resources.length+v.resourceTemplates.length)+" resources",1),a.expandedMcpNames.has(v.name)?(l(),o("div",On,[v.tools.length>0?(l(),o("div",Rn,[_[4]||(_[4]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",Bn,i(v.tools.map(c=>c.title||c.name).join(", ")),1)])):u("",!0),v.resources.length>0||v.resourceTemplates.length>0?(l(),o("div",Gn,[_[5]||(_[5]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",Kn,i([...v.resources.map(c=>c.title||c.name||c.uri),...v.resourceTemplates.map(c=>c.title||c.name||c.uriTemplate)].join(", ")),1)])):u("",!0)])):u("",!0)],8,En)]))),128))])):(l(),o("div",Pn," MCP status APIs unavailable in this Codex CLI. Update Codex CLI to inspect MCP servers. "))])):u("",!0)])]),_:1},8,["try-in-flight-key"])]))}}),Hn=ot(jn,[["__scopeId","data-v-6fa6298d"]]),qn={class:"directory-hub"},zn={class:"directory-header"},Vn={class:"directory-title"},Qn={class:"directory-subtitle"},Wn={class:"directory-header-actions"},Jn=["disabled"],Yn={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},Zn=["aria-selected","onClick"],Xn={class:"directory-modal"},er={class:"directory-modal-header"},tr={class:"directory-card-top"},sr=["src","alt"],ar={class:"directory-card-main"},lr={class:"directory-modal-title"},or={class:"directory-card-meta"},ir=["aria-label"],nr={class:"directory-modal-body"},rr={key:0,class:"directory-error"},cr={key:1,class:"directory-loading"},dr={key:0,class:"directory-detail-description"},ur={key:1,class:"directory-detail-block"},pr={class:"directory-chip-row"},yr={class:"directory-detail-grid"},mr={key:0,class:"directory-detail-block"},hr={class:"directory-detail-heading"},vr={key:0,class:"directory-auth-status is-warning"},gr=["onClick"],br={key:1,class:"directory-detail-block"},kr={class:"directory-detail-heading"},fr={class:"directory-mini-list"},$r={key:2,class:"directory-detail-block"},Cr=["disabled","onClick"],wr={key:2,class:"directory-screenshots"},Sr=["src"],_r={key:3,class:"directory-auth-panel"},Lr=["onClick"],Pr={class:"directory-modal-footer"},Ar=["disabled"],Ir=["disabled"],Mr={key:2,class:"directory-action",type:"button",disabled:""},Fr=["disabled"],Er=["disabled"],Tr={class:"directory-modal directory-modal--share"},Ur={class:"directory-modal-header"},Dr={class:"directory-card-main"},Nr={class:"directory-modal-title"},xr={class:"directory-card-meta"},Or=["aria-label"],Rr={class:"directory-modal-body"},Br={key:0,class:"directory-error"},Gr={key:1,class:"directory-loading"},Kr={key:0,class:"directory-empty"},jr={key:1,class:"directory-share-list"},Hr={class:"directory-share-info"},qr={class:"directory-share-name"},zr=["href"],Vr=["disabled","onClick"],Qr=["disabled","onClick"],Wr=["disabled"],Jr={class:"directory-modal"},Yr={class:"directory-modal-header"},Zr={class:"directory-card-top"},Xr=["src","alt"],ec={class:"directory-card-main"},tc={class:"directory-modal-title"},sc={class:"directory-card-meta"},ac=["aria-label"],lc={class:"directory-modal-body"},oc={key:0,class:"directory-error"},ic={key:1,class:"directory-loading"},nc={key:0,class:"directory-detail-description"},rc={class:"directory-detail-grid"},cc={class:"directory-detail-block"},dc={class:"directory-chip-row"},uc={class:"directory-chip"},pc={key:0,class:"directory-chip"},yc={key:1,class:"directory-chip"},mc={key:2,class:"directory-chip"},hc={class:"directory-detail-block"},vc={key:0,class:"directory-mini-list"},gc={key:1},bc={class:"directory-card-meta"},kc={key:1,class:"directory-detail-block"},fc={class:"directory-card-meta"},$c={class:"directory-modal-footer"},Cc=["disabled"],wc=["disabled"],Sc=50,Jt=100,Pc=be({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(a,{expose:N,emit:f}){const M=[[/^gmail$/i,3e4],[/^google calendar$/i,29500],[/^outlook( email| calendar)?$/i,29e3],[/^google drive$/i,28500],[/^google docs$/i,28e3],[/^google sheets$/i,27500],[/^dropbox$/i,27e3],[/^box$/i,26500],[/^slack$/i,26e3],[/^notion$/i,25500],[/^canva$/i,25e3],[/^figma$/i,24500],[/^github$/i,24e3],[/^trello$/i,23500],[/^asana$/i,23e3],[/^basecamp$/i,22500],[/^clickup$/i,22e3],[/^linear$/i,21500],[/^gitlab( issues)?$/i,21e3],[/^jira$/i,20500],[/^zapier$/i,2e4],[/^hubspot$/i,19500],[/^salesforce$/i,19e3],[/^netlify$/i,18500],[/^vercel$/i,18e3],[/^(spotify|youtube|netflix|hulu|disney|booking|expedia|uber|airbnb)$/i,17500]],_=[[/(email|mail|inbox|calendar|event|availability|contact|message|chat)/i,450],[/(drive|document|docs|sheet|slide|file|storage|pdf|note|page)/i,380],[/(image|design|presentation|diagram|video|audio|photo|media|music)/i,320],[/(travel|flight|hotel|restaurant|recipe|food|shopping|delivery|map|weather)/i,260],[/(learn|education|study|language|health|fitness|finance|budget)/i,220],[/(task|project|issue|repository|deploy|database|crm|sales|support)/i,120]],v=[[/(computer use|github|gitlab|linear|slack|notion|browser|web|filesystem|terminal)/i,120],[/(calendar|email|drive|docs|design|deploy|project|issue|search|database)/i,55]],c=[[/(github|gitlab|linear|slack|notion|filesystem|browser|computer|web|postgres|sqlite|database)/i,120],[/(search|drive|docs|calendar|terminal|shell|deploy|cloud|memory)/i,55]],p=a,I=f,x=ca(),H=da(),{t:r}=lt(),G=S(()=>[{id:"plugins",label:r("Plugins"),subtitle:r("Plugins make Codex work your way.")},{id:"apps",label:r("Apps"),subtitle:r("Connect Codex to external apps and services.")},{id:"composio",label:"Composio",subtitle:r("Browse Composio connectors, auth state, and ready-to-try integrations.")},{id:"skills",label:r("Skills"),subtitle:r("MCPs first, then installed skills and GitHub sync state.")}]),q=[{name:"Gmail",slug:"gmail",meta:"Inbox, drafts, attachments",description:"Find emails, summarize threads, draft replies, and pull attachment context into a chat.",chips:["Email","Search","Drafts"]},{name:"Google Calendar",slug:"google-calendar",meta:"Events and availability",description:"Check what is next, find open time, and turn follow-ups into calendar blocks.",chips:["Events","Availability","Reminders"]},{name:"Reddit",slug:"reddit",meta:"Posts, comments, communities",description:"Search communities, inspect posts, and prepare natural replies before posting.",chips:["Search","Comments","Posts"]},{name:"YouTube",slug:"youtube",meta:"Videos, channels, comments",description:"Look up channel details, inspect video metadata, and help manage comment workflows.",chips:["Videos","Channels","Comments"]},{name:"Google Drive",slug:"google-drive",meta:"Files, docs, folders",description:"Find files, read shared docs, and bring Drive context into a Codex thread.",chips:["Files","Docs","Search"]},{name:"X",slug:"x",meta:"Posts, replies, profiles",description:"Research public posts, draft replies, and keep social workflows reviewable.",chips:["Posts","Replies","Profiles"]}];function z(e){return e==="plugins"||e==="apps"||e==="composio"||e==="skills"}function te(){return z(x.query.tab)?x.query.tab:"skills"}const F=m(te()),$=m(new Set),w=m(!1),k=m([]),V=m([]),A=m(null),D=m([]),K=m(null),Q=m(0),X=m([]),me=m("popular"),se=m("popular"),ke=m("popular"),ae=m(""),le=m(""),Z=m(""),W=m(!1),he=m(!1),fe=m(!1),Me=m(!1),Re=m(!1),ce=m(!1),Fe=m(!0),Be=m(""),Ge=m(""),Ke=m(""),je=m(""),L=m(null),U=m(null),$e=m(!1),He=m(!1),Ee=m(""),P=m(null),de=m(!1),qe=m(!1),Ce=m(""),Te=m(!1),Ue=m(!1),J=m(!1),De=m(""),ve=m(""),ue=m([]),we=m(""),O=m(new Set),Se=m(null),g=m(""),h=m(""),b=m(!1),R=m([]),oe=m(!1),ie=m(!1),ee=m(!1),pe=m(""),_e=m("");let ze=null,Ve=null;Yt(()=>{ze&&clearTimeout(ze),Ve&&clearTimeout(Ve)});let it=!1;const Xt=S(()=>G.value.find(e=>e.id===F.value)??G.value[0]),ht=S(()=>!w.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>$.value.has(e))),Je=S(()=>!w.value||$.value.has("app/list")),nt=S(()=>!w.value||$.value.has("mcpServerStatus/list")),vt=S(()=>$.value.has("config/mcpServer/reload")),gt=S(()=>$.value.has("mcpServer/oauth/login")),es=S(()=>!w.value||["marketplace/add","marketplace/remove","marketplace/upgrade"].every(e=>$.value.has(e))),ts=S(()=>!w.value||["plugin/share/save","plugin/share/list","plugin/share/delete"].every(e=>$.value.has(e))),Le=S(()=>(p.tryInFlightKey??"").length>0),bt=S(()=>{var e,t,d;return((e=U.value)==null?void 0:e.description)||((t=U.value)==null?void 0:t.summary.longDescription)||((d=U.value)==null?void 0:d.summary.description)||""}),kt=S(()=>{var t;const e=(t=U.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(Xe)].filter(Boolean):[]}),rt=S(()=>{var d;const e=((d=U.value)==null?void 0:d.apps)??[];if(e.length===0)return!1;const t=new Set;for(const C of V.value)t.add(C.id.trim().toLowerCase()),t.add(wt(C.name));return e.some(C=>{const j=C.id.trim().toLowerCase(),ge=wt(C.name),Ae=j.length>0&&t.has(j),tt=ge.length>0&&t.has(ge);return!Ae&&!tt})}),ss=S(()=>{var e,t;return((e=L.value)==null?void 0:e.installPolicy)==="NOT_AVAILABLE"||(((t=U.value)==null?void 0:t.apps.some(d=>Ct(d)))??!1)}),as=S(()=>bs(ws(fs(k.value,ae.value),me.value),me.value,ae.value)),ls=S(()=>{const e=new Map;for(const t of k.value){if(!t.marketplaceName)continue;const d=t.marketplaceName;e.has(d)||e.set(d,{name:t.marketplaceName,displayName:t.marketplaceDisplayName||t.marketplaceName,path:t.marketplacePath})}return[...e.values()].sort((t,d)=>t.displayName.localeCompare(d.displayName))}),os=S(()=>ks(Ss($s(V.value,le.value),se.value),se.value,le.value)),is=S(()=>ua(Cs(D.value,Z.value),ke.value,Z.value)),ns=S(()=>{const e=Qe(Z.value);return e?q.filter(t=>Ye([t.name,t.slug,t.meta,t.description,...t.chips],e)):q}),rs=S(()=>_s(X.value)),ft=S(()=>K.value!==null),cs=S(()=>new Map(X.value.map(e=>[e.name,e]))),ds=S(()=>{const e=A.value;return e&&[e.email||e.defaultOrgName,e.defaultOrgId?`org ${e.defaultOrgId}`:"",e.baseUrl||""].filter(Boolean).join(" · ")||r("Composio CLI shares the login and connections from this machine.")});function Qe(e){return e.trim().toLowerCase()}function us(e){return Qe(e).replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").replace(/[-_]+/gu," ").replace(/\s+plugin$/iu,"").replace(/\s+/gu," ").trim()}function $t(...e){const t=new Set;for(const d of e){const C=us(d);C&&(t.add(C),t.add(C.replace(/\s+/gu,"")))}return Array.from(t)}function ps(e){return!e.isAccessible&&e.installUrl.trim().length===0}function ys(e){const t=e.id.trim();if(t){const C=V.value.find(j=>j.id===t);if(C)return C}const d=$t(e.name);return V.value.find(C=>$t(C.name).some(j=>d.includes(j)))??null}function Ct(e){const t=ys(e);return t?ps(t):e.needsAuth&&e.installUrl.trim().length===0}function Ye(e,t){const d=Qe(t);return d?e.some(C=>C==null?void 0:C.toLowerCase().includes(d)):!0}function Ze(e,t){return t.reduce((d,[C,j])=>d+(C.test(e)?j:0),0)}function ct(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function wt(e){return ct(e).toLowerCase()}function ms(e){return e==="DEFAULT_OAI_CATALOG"?r("OpenAI catalog"):e==="ECOSYSTEM_DIRECTORY"?r("Ecosystem directory"):e?e.replace(/_/gu," ").toLowerCase().replace(/\b\w/gu,t=>t.toUpperCase()):""}function hs(e){return e.developer||ms(e.distributionChannel)||r("App")}function dt(e){var t;return((t=cs.value.get(e))==null?void 0:t.authStatus)??"unknown"}function St(e){const t=dt(e);return r(t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown")}function vs(e){const t=dt(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function gs(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function _t(e){return gt.value&&dt(e)==="notLoggedIn"}function bs(e,t,d){return t==="popular"&&Qe(d).length===0?e.slice(0,Jt):e}function ks(e,t,d){if(t!=="popular"||Qe(d).length>0)return e;const C=new Set,j=[];for(const ge of e){const Ae=ct(ge.name).toLowerCase();if(!C.has(Ae)&&(C.add(Ae),j.push(ge),j.length>=Jt))break}return j}function fs(e,t){return e.filter(d=>Ye([d.displayName,d.name,d.description,d.developerName,d.category,d.marketplaceDisplayName,...d.capabilities],t))}function $s(e,t){return e.filter(d=>Ye([d.name,d.description,d.developer,d.category,d.distributionChannel,...d.pluginDisplayNames],t))}function Cs(e,t){return e.filter(d=>Ye([d.name,d.slug,d.description,...d.authModes,...d.connectionStatuses],t))}function Lt(e){return(e.installed?500:0)+(e.enabled?40:0)+(e.developerName.toLowerCase().includes("openai")?140:0)+(e.sourceType==="local"?80:0)+e.capabilities.length*12+Ze(`${e.displayName} ${e.name} ${e.description} ${e.category}`,v)}function Pt(e){const t=ct(e.name);return(e.isAccessible?1e4:0)+Ze(t,M)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+Ze(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,_)-e.catalogRank*.001}function At(e){return(e.authStatus==="oAuth"?180:0)+(e.authStatus==="bearerToken"?140:0)+Math.min(e.tools.length,50)*6+Math.min(e.resources.length+e.resourceTemplates.length,30)*3+Ze(e.name,c)}function ws(e,t){return t==="name"?[...e].sort((d,C)=>d.displayName.localeCompare(C.displayName)):t==="date"?[...e]:[...e].sort((d,C)=>Lt(C)-Lt(d)||d.displayName.localeCompare(C.displayName))}function Ss(e,t){return t==="name"?[...e].sort((d,C)=>d.name.localeCompare(C.name)):t==="date"?[...e].sort((d,C)=>d.catalogRank-C.catalogRank):[...e].sort((d,C)=>Pt(C)-Pt(d)||d.name.localeCompare(C.name))}function _s(e,t){return[...e].sort((d,C)=>At(C)-At(d)||d.name.localeCompare(C.name))}function E(e,t="success"){Se.value={text:e,type:t},ze&&clearTimeout(ze),ze=setTimeout(()=>{Se.value=null},3e3)}function Xe(e){return e?e.startsWith("connectors://")?`/codex-api/connector-logo?src=${encodeURIComponent(e)}`:/^https?:\/\//i.test(e)||e.startsWith("data:")?e:e.startsWith("/")?`/codex-local-image?path=${encodeURIComponent(e)}`:"":""}function ut(e){return e?e.logoUrl||Xe(e.logoPath)||e.composerIconUrl||Xe(e.composerIconPath):""}function Ls(e){return Xe(e.logoUrlDark||e.logoUrl)}function It(e){return e.activeCount>0?`${e.activeCount} ${r("connected")} ${e.activeCount===1?r("account"):r("accounts")}`:e.isNoAuth?r("No auth required"):e.connectionStatuses.length>0?e.connectionStatuses.join(", "):e.authModes.join(", ")||r("Connection required")}function Ps(e){return e.isNoAuth||e.activeCount>0}function pt(e){return e.isNoAuth?"":e.activeCount>0?r("Manage"):e.totalConnections>0?r("Reconnect"):r("Connect")}function As(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?r("Active"):t==="EXPIRED"?r("Expired"):t==="FAILED"?r("Failed"):t==="INITIATED"?r("Pending"):t||r("Unknown")}function Is(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function Ms(e){return`app:${e.id}:`}function Fs(e){Le.value||I("try-item",{kind:"app",name:e.id,displayName:e.name})}function Es(e){return`plugin:${e.name}:`}function Mt(e){return`composio:${e}:`}function Ts(e){Le.value||I("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function Ft(e){return Ps(e)}function Us(e,t=[]){const d=t.find(j=>j.status==="ACTIVE"&&!j.isDisabled),C=d!=null&&d.wordId?` If there are multiple accounts, prefer \`${d.wordId}\`.`:"";return`Use the Composio CLI skill with the ${e.name} connector (${e.slug}). Start by listing what it can do here, mention the current connection status, and suggest one safe command I can run now.${C}`}function Et(e,t=[]){Le.value||I("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:Us(e,t),attachedSkills:[{name:"composio-cli"}]})}function ne(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function Ds(e){const t=e.find(d=>d.needsAuth&&d.installUrl.trim().length>0);return t?(ne(t.installUrl),!0):!1}async function Ns(){try{$.value=new Set(await pa())}catch{$.value=new Set}finally{w.value=!0}}async function ye(){var e;if(ht.value){W.value=!0,Be.value="";try{const t=(e=p.cwd)==null?void 0:e.trim(),[d]=await Promise.all([ya(t?[t]:void 0),Je.value?Ne():Promise.resolve()]);k.value=d}catch(t){Be.value=t instanceof Error?t.message:"Failed to load plugins"}finally{W.value=!1}}}async function xs(){const e=g.value.trim();if(e){b.value=!0,h.value="add";try{await ma(e),g.value="",E("Marketplace added"),await ye()}catch(t){E(t instanceof Error?t.message:"Failed to add marketplace","error")}finally{b.value=!1,h.value=""}}}async function Os(e){b.value=!0,h.value=`remove:${e}`;try{await ha(e),E("Marketplace removed"),await ye()}catch(t){E(t instanceof Error?t.message:"Failed to remove marketplace","error")}finally{b.value=!1,h.value=""}}async function Rs(){b.value=!0,h.value="upgrade";try{const e=await va();e.errors.length>0?E(e.errors.join("; "),"error"):E(`Upgraded ${e.upgradedRoots.length||e.selectedMarketplaces.length||"all"} marketplace${e.upgradedRoots.length+e.selectedMarketplaces.length===1?"":"s"}`),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to upgrade marketplaces","error")}finally{b.value=!1,h.value=""}}async function Ne(){var e;if(Je.value){he.value=!0,Ge.value="";try{V.value=await ga(((e=p.threadId)==null?void 0:e.trim())||void 0)}catch(t){Ge.value=t instanceof Error?t.message:"Failed to load apps"}finally{he.value=!1}}}async function Pe(e=!1){if(fe.value){it=!0;return}fe.value=!0,Ke.value="";try{const t=await ba();if(A.value=t,!t.available||!t.authenticated){D.value=[],K.value=null,Q.value=0;return}const d=e?K.value:null,C=await ka(Z.value,d,Sc);D.value=e?[...D.value,...C.data]:C.data,K.value=C.nextCursor,Q.value=C.total}catch(t){Ke.value=t instanceof Error?t.message:"Failed to load Composio connectors",D.value=[],K.value=null,Q.value=0}finally{fe.value=!1,it&&(it=!1,Pe())}}async function Bs(){!ft.value||fe.value||await Pe(!0)}async function et(){if(nt.value){Me.value=!0,je.value="";try{X.value=await Qt()}catch(e){je.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{Me.value=!1}}}async function Tt(){var e;if(!(!nt.value||!((e=U.value)!=null&&e.mcpServers.length)))try{X.value=await Qt()}catch{}}function Ut(e=!1){F.value==="plugins"&&ye(),F.value==="apps"&&Ne(),F.value==="composio"&&Pe(),F.value==="skills"&&(e&&vt.value?jt():et())}function Gs(e){if(e==="app/list/updated"){Ne();return}(e==="mcpServer/startupStatus/updated"||e==="mcpServer/oauthLogin/completed")&&et()}N({refreshFromNotification:Gs});async function Ks(){ce.value=!0;try{F.value==="plugins"?await ye():F.value==="apps"?await Ne():F.value==="composio"?await Pe():F.value==="skills"&&vt.value?await jt():F.value==="skills"&&await et()}finally{ce.value=!1}}async function Dt(e){L.value=e,U.value=null,Ee.value="",ue.value=[],$e.value=!0,He.value=!0;try{U.value=await fa(e),L.value=U.value.summary,Je.value&&V.value.length===0&&await Ne(),await Tt()}catch(t){Ee.value=t instanceof Error?t.message:"Failed to load plugin"}finally{He.value=!1}}async function Nt(e){if(!gt.value)return!1;we.value=e;try{const t=await $a(e);return t.authorizationUrl?(ne(t.authorizationUrl),!0):(E(r("No login URL returned for {name}",{name:e}),"error"),!1)}catch(t){return E(t instanceof Error?t.message:r("Failed to start login for {name}",{name:e}),"error"),!1}finally{we.value=""}}async function js(e){await Tt();const t=e.mcpServers.find(d=>_t(d));t&&await Nt(t)}function yt(){$e.value=!1}function xt(){const e=L.value;return e?e.marketplacePath?`${e.marketplacePath.replace(/[\\/]+$/,"")}/${e.name}`:e.sourceUrl||"":""}async function Ot(){_e.value="",oe.value=!0,ie.value=!0;try{R.value=await Ca()}catch(e){_e.value=e instanceof Error?e.message:"Failed to load plugin shares"}finally{ie.value=!1}}async function Hs(){const e=xt();if(e){ee.value=!0,pe.value="save";try{const t=await wa(e);E(t.shareUrl?"Plugin shared":"Plugin shared (no URL returned)"),await Ot()}catch(t){_e.value=t instanceof Error?t.message:"Failed to share plugin"}finally{ee.value=!1,pe.value=""}}}async function qs(e){ee.value=!0,pe.value=`delete:${e}`;try{await Sa(e),R.value=R.value.filter(t=>t.remotePluginId!==e),E("Share removed")}catch(t){_e.value=t instanceof Error?t.message:"Failed to remove share"}finally{ee.value=!1,pe.value=""}}async function zs(e){ee.value=!0,pe.value=`checkout:${e}`;try{await _a(e),E("Plugin checked out")}catch(t){_e.value=t instanceof Error?t.message:"Failed to checkout plugin"}finally{ee.value=!1,pe.value=""}}function Rt(){oe.value=!1}async function Bt(e){de.value=!0,qe.value=!0,Ce.value="",P.value=null;try{P.value=await La(e)}catch(t){Ce.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{qe.value=!1}}function Gt(){de.value=!1}async function Vs(e){var t;ve.value=e.slug;try{const d=await Ua(e.slug);if(!d.redirectUrl){E(r("No login URL returned for {name}",{name:e.name}),"error");return}ne(d.redirectUrl),E(r("Opened {name} authorization",{name:e.name})),await Pe(),de.value&&((t=P.value)==null?void 0:t.connector.slug)===e.slug&&await Bt(e.slug)}catch(d){E(d instanceof Error?d.message:r("Failed to connect {name}",{name:e.name}),"error")}finally{ve.value=""}}async function Kt(e){var t;if(e.activeCount>0&&((t=A.value)!=null&&t.webUrl)){ne(A.value.webUrl);return}await Vs(e)}async function Qs(){Ue.value=!0;const e=window.open("about:blank","_blank");e&&(e.opener=null);try{const t=await Pa();t.loginUrl&&e?e.location.href=t.loginUrl:t.loginUrl?ne(t.loginUrl):e==null||e.close(),E("Composio CLI login started")}catch(t){e==null||e.close(),E(t instanceof Error?t.message:"Failed to start Composio login","error")}finally{Ue.value=!1}}async function Ws(){Te.value=!0;try{await Aa(),E("Composio CLI installed"),await Pe()}catch(e){E(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{Te.value=!1}}async function Js(){if(L.value&&!rt.value){J.value=!0;try{const e=await Ia(L.value);ue.value=e.appsNeedingAuth,E(`${L.value.displayName} ${r("plugin installed")}`);const t=Ds(e.appsNeedingAuth);await ye();const d=k.value.find(C=>{var j;return C.id===((j=L.value)==null?void 0:j.id)});d&&(await Dt(d),!t&&U.value&&await js(U.value))}catch(e){E(e instanceof Error?e.message:"Failed to install plugin","error")}finally{J.value=!1}}}async function Ys(){if(L.value){J.value=!0;try{const e=L.value.displayName;await Ma(L.value.id),E(`${e} ${r("plugin uninstalled")}`),yt(),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{J.value=!1}}}async function Zs(){if(L.value){J.value=!0;try{const e=!L.value.enabled;await Fa(L.value.id,e),L.value={...L.value,enabled:e},U.value&&(U.value={...U.value,summary:{...U.value.summary,enabled:e}}),E(`${L.value.displayName} ${r("plugin")} ${r(e?"enabled":"disabled")}`),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to update plugin","error")}finally{J.value=!1}}}async function Xs(e){De.value=e.id;try{const t=!e.isEnabled;await Ea(e.id,t),V.value=V.value.map(d=>d.id===e.id?{...d,isEnabled:t}:d),E(`${e.name} ${r("app")} ${r(t?"enabled":"disabled")}`)}catch(t){E(t instanceof Error?t.message:"Failed to update app","error")}finally{De.value=""}}async function jt(){Re.value=!0;try{await Ta(),await et(),E("MCP servers reloaded")}catch(e){E(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{Re.value=!1}}function ea(e){const t=new Set(O.value);t.has(e)?t.delete(e):t.add(e),O.value=t}return Ie(F,e=>{x.name==="skills"&&x.query.tab!==e&&H.replace({name:"skills",query:{...x.query,tab:e}}),Ut()}),Ie(()=>x.query.tab,()=>{if(x.name!=="skills")return;const e=te();F.value!==e&&(F.value=e)}),Ie(Z,()=>{F.value==="composio"&&(D.value=[],K.value=null,Q.value=0,Ve&&clearTimeout(Ve),Ve=setTimeout(()=>{Pe()},250))}),Ie(()=>p.cwd,()=>{F.value==="plugins"&&ye()}),Ie(()=>p.threadId,()=>{(F.value==="apps"||F.value==="plugins")&&Ne()}),Zt(async()=>{await Ns(),Ut()}),(e,t)=>{var d,C,j,ge,Ae,tt,Ht,qt;return l(),o("div",qn,[s("div",zn,[s("div",null,[s("h2",Vn,i(n(r)("Skills"))+" & "+i(n(r)("Apps")),1),s("p",Qn,i(Xt.value.subtitle),1)]),s("div",Wn,[s("button",{class:"directory-refresh",type:"button",disabled:ce.value,onClick:Ks},i(ce.value?"Refreshing...":"Refresh"),9,Jn)])]),s("div",Yn,[(l(!0),o(T,null,B(G.value,y=>(l(),o("button",{key:y.id,class:Y(["directory-tab",{"is-active":F.value===y.id}]),type:"button",role:"tab","aria-selected":F.value===y.id,onClick:We=>F.value=y.id},i(y.label),11,Zn))),128))]),Se.value?(l(),o("div",{key:0,class:Y(["directory-toast",{"is-error":Se.value.type==="error"}])},i(Se.value.text),3)):u("",!0),F.value==="plugins"?(l(),re(Qo,{key:1,plugins:as.value,"search-query":ae.value,"sort-mode":me.value,"supports-plugins":ht.value,"supports-marketplace":es.value,error:Be.value,"is-loading":W.value,marketplaces:ls.value,"marketplace-source-url":g.value,"marketplace-action-name":h.value,"is-marketplace-action-in-flight":b.value,"plugin-icon-src":ut,"open-plugin-detail":Dt,"add-marketplace":xs,"remove-marketplace":Os,"upgrade-all-marketplaces":Rs,"disabled-label":n(r)("Disabled"),"installed-label":n(r)("Installed"),"plugin-label":n(r)("Plugin"),"upgrade-all-label":n(r)("Upgrade all"),"upgrading-label":n(r)("Upgrading..."),"removing-label":n(r)("Removing..."),"remove-label":n(r)("Remove"),"adding-label":n(r)("Adding..."),"add-label":n(r)("Add"),"onUpdate:searchQuery":t[0]||(t[0]=y=>ae.value=y),"onUpdate:sortMode":t[1]||(t[1]=y=>me.value=y),"onUpdate:marketplaceSourceUrl":t[2]||(t[2]=y=>g.value=y)},null,8,["plugins","search-query","sort-mode","supports-plugins","supports-marketplace","error","is-loading","marketplaces","marketplace-source-url","marketplace-action-name","is-marketplace-action-in-flight","disabled-label","installed-label","plugin-label","upgrade-all-label","upgrading-label","removing-label","remove-label","adding-label","add-label"])):F.value==="apps"?(l(),re(nl,{key:2,apps:os.value,"search-query":le.value,"sort-mode":se.value,"supports-apps":Je.value,error:Ge.value,"is-loading":he.value,"action-id":De.value,"try-in-flight-key":p.tryInFlightKey,"is-try-action-in-flight":Le.value,"app-logo-src":Ls,"app-meta-label":hs,"app-try-key":Ms,"toggle-app":Xs,"open-external-url":ne,"try-app":Fs,"disabled-label":n(r)("Disabled"),"connected-label":n(r)("Connected"),"enable-label":n(r)("Enable"),"disable-label":n(r)("Disable"),"manage-label":n(r)("Manage"),"login-label":n(r)("Login"),"try-label":n(r)("Try it!"),"starting-label":n(r)("Starting..."),"onUpdate:searchQuery":t[3]||(t[3]=y=>le.value=y),"onUpdate:sortMode":t[4]||(t[4]=y=>se.value=y)},null,8,["apps","search-query","sort-mode","supports-apps","error","is-loading","action-id","try-in-flight-key","is-try-action-in-flight","disabled-label","connected-label","enable-label","disable-label","manage-label","login-label","try-label","starting-label"])):F.value==="composio"?(l(),re(mo,{key:3,"composio-status":A.value,"search-query":Z.value,"sort-mode":ke.value,error:Ke.value,"is-loading-composio":fe.value,"is-installing-composio":Te.value,"is-starting-composio-login":Ue.value,"visible-composio-connectors":is.value,"visible-composio-preview-connectors":ns.value,"workspace-summary":ds.value,"connector-count":D.value.length,total:Q.value,"has-more-composio-connectors":ft.value,"action-slug":ve.value,"is-try-action-in-flight":Le.value,"try-in-flight-key":p.tryInFlightKey,"composio-meta-label":It,"composio-primary-action-label":pt,"can-try-composio":Ft,"composio-try-key":Mt,"open-composio-detail":Bt,"run-composio-primary-action":Kt,"try-composio":Et,"install-composio-cli":Ws,"start-composio-cli-login":Qs,"load-more-composio":Bs,"open-external-url":ne,"workspace-label":n(r)("Composio workspace"),"connected-label":n(r)("Connected"),"authenticated-label":n(r)("Authenticated"),"no-auth-label":n(r)("No auth"),"preview-label":n(r)("Preview"),"open-dashboard-label":n(r)("Open dashboard"),"details-label":n(r)("Details"),"install-label":n(r)("Install Composio"),"installing-label":n(r)("Installing..."),"login-label":n(r)("Login to Composio"),"opening-label":n(r)("Opening..."),"starting-label":n(r)("Starting..."),"try-label":n(r)("Try it!"),"load-more-label":n(r)("Load more"),"loading-label":n(r)("Loading..."),"onUpdate:searchQuery":t[5]||(t[5]=y=>Z.value=y),"onUpdate:sortMode":t[6]||(t[6]=y=>ke.value=y)},null,8,["composio-status","search-query","sort-mode","error","is-loading-composio","is-installing-composio","is-starting-composio-login","visible-composio-connectors","visible-composio-preview-connectors","workspace-summary","connector-count","total","has-more-composio-connectors","action-slug","is-try-action-in-flight","try-in-flight-key","workspace-label","connected-label","authenticated-label","no-auth-label","preview-label","open-dashboard-label","details-label","install-label","installing-label","login-label","opening-label","starting-label","try-label","load-more-label","loading-label"])):F.value==="skills"?(l(),re(Hn,{key:4,"try-in-flight-key":p.tryInFlightKey,"supports-mcps":nt.value,"mcp-error":je.value,"is-loading-mcps":Me.value,"visible-mcp-servers":rs.value,"is-mcp-section-open":Fe.value,"expanded-mcp-names":O.value,"format-mcp-auth-status":St,"mcp-card-badge-class":gs,"toggle-mcp-section-open":()=>{Fe.value=!Fe.value},"toggle-mcp-expanded":ea,onSkillsChanged:t[7]||(t[7]=y=>I("skills-changed")),onTryItem:t[8]||(t[8]=y=>I("try-item",y))},null,8,["try-in-flight-key","supports-mcps","mcp-error","is-loading-mcps","visible-mcp-servers","is-mcp-section-open","expanded-mcp-names","toggle-mcp-section-open"])):u("",!0),(l(),re(st,{to:"body"},[$e.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(yt,["self"])},[s("article",Xn,[s("div",er,[s("div",tr,[L.value&&ut(L.value)?(l(),o("img",{key:0,class:"directory-card-icon",src:ut(L.value),alt:L.value.displayName,loading:"lazy"},null,8,sr)):u("",!0),s("div",ar,[s("h3",lr,i(((d=L.value)==null?void 0:d.displayName)||n(r)("Plugin")),1),s("span",or,i(((C=L.value)==null?void 0:C.developerName)||((j=L.value)==null?void 0:j.marketplaceDisplayName)||((ge=L.value)==null?void 0:ge.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin detail"),onClick:yt},i(n(r)("Close")),9,ir)]),s("div",nr,[Ee.value?(l(),o("div",rr,i(Ee.value),1)):He.value?(l(),o("div",cr,"Loading plugin...")):U.value?(l(),o(T,{key:2},[bt.value?(l(),o("p",dr,i(bt.value),1)):u("",!0),U.value.summary.capabilities.length>0?(l(),o("div",ur,[t[13]||(t[13]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",pr,[(l(!0),o(T,null,B(U.value.summary.capabilities,y=>(l(),o("span",{key:y,class:"directory-chip"},i(y),1))),128))])])):u("",!0),s("div",yr,[U.value.apps.length>0?(l(),o("div",mr,[s("h4",hr,i(n(r)("Apps")),1),(l(!0),o(T,null,B(U.value.apps,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,i(y.name),1),Ct(y)?(l(),o("span",vr,"GPT Plus account required")):y.installUrl?(l(),o("button",{key:1,type:"button",onClick:We=>ne(y.installUrl)},i(y.needsAuth?"Login":"Manage"),9,gr)):u("",!0)]))),128))])):u("",!0),U.value.skills.length>0?(l(),o("div",br,[s("h4",kr,i(n(r)("Skills")),1),s("p",fr,i(U.value.skills.map(y=>y.displayName||y.name).join(", ")),1)])):u("",!0),U.value.mcpServers.length>0?(l(),o("div",$r,[t[14]||(t[14]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(l(!0),o(T,null,B(U.value.mcpServers,y=>(l(),o("div",{key:y,class:"directory-include-row"},[s("span",null,[at(i(y)+" ",1),s("span",{class:Y(["directory-auth-status",vs(y)])},i(St(y)),3)]),_t(y)?(l(),o("button",{key:0,type:"button",disabled:we.value===y,onClick:We=>Nt(y)},i(we.value===y?"Opening...":"Authenticate"),9,Cr)):u("",!0)]))),128))])):u("",!0)]),kt.value.length>0?(l(),o("div",wr,[(l(!0),o(T,null,B(kt.value,y=>(l(),o("img",{key:y,src:y,alt:"",loading:"lazy"},null,8,Sr))),128))])):u("",!0),ue.value.length>0?(l(),o("div",_r,[s("strong",null,i(n(r)("Apps needing auth")),1),(l(!0),o(T,null,B(ue.value,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,i(y.name),1),y.installUrl?(l(),o("button",{key:0,type:"button",onClick:We=>ne(y.installUrl)},i(n(r)("Login")),9,Lr)):u("",!0)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",Pr,[L.value&&L.value.installed?(l(),o("button",{key:0,class:"directory-action danger",type:"button",disabled:J.value,onClick:Ys},i(J.value?"Uninstalling...":"Uninstall"),9,Ar)):L.value&&!ss.value?(l(),o("button",{key:1,class:"directory-action primary",type:"button",disabled:J.value||L.value.installPolicy==="NOT_AVAILABLE"||rt.value,onClick:Js},i(rt.value?"ChatGPT Plus":J.value?"Installing...":"Install"),9,Ir)):L.value?(l(),o("button",Mr," GPT Plus account required ")):u("",!0),L.value&&L.value.installed?(l(),o("button",{key:3,class:"directory-action",type:"button",disabled:J.value,onClick:Zs},i(L.value.enabled?"Disable":"Enable"),9,Fr)):u("",!0),L.value&&L.value.installed&&L.value.enabled?(l(),o("button",{key:4,class:"directory-action primary",type:"button",disabled:J.value||Le.value,onClick:t[9]||(t[9]=y=>Ts(L.value))},i(p.tryInFlightKey===Es(L.value)?"Starting...":"Try it!"),9,Er)):u("",!0),ts.value&&L.value&&L.value.installed?(l(),o("button",{key:5,class:"directory-action",type:"button",onClick:Ot},i(n(r)("Share")),1)):u("",!0)])])])):u("",!0)])),(l(),re(st,{to:"body"},[oe.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(Rt,["self"])},[s("article",Tr,[s("div",Ur,[s("div",Dr,[s("h3",Nr,i(n(r)("Plugin shares")),1),s("span",xr,i(((Ae=L.value)==null?void 0:Ae.displayName)||n(r)("Plugin")),1)]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin shares"),onClick:Rt},i(n(r)("Close")),9,Or)]),s("div",Rr,[_e.value?(l(),o("div",Br,i(_e.value),1)):ie.value?(l(),o("div",Gr,"Loading shares...")):(l(),o(T,{key:2},[R.value.length===0?(l(),o("p",Kr,"No shares yet. Share this plugin to make it available on other devices.")):(l(),o("div",jr,[(l(!0),o(T,null,B(R.value,y=>(l(),o("div",{key:y.remotePluginId,class:"directory-share-row"},[s("div",Hr,[s("span",qr,i(y.pluginName),1),y.shareUrl?(l(),o("a",{key:0,class:"directory-share-link",href:y.shareUrl,target:"_blank",rel:"noreferrer"},i(y.shareUrl),9,zr)):u("",!0)]),s("button",{class:"directory-share-checkout",type:"button",disabled:ee.value,onClick:We=>zs(y.remotePluginId)},i(pe.value===`checkout:${y.remotePluginId}`?n(r)("Checking out..."):n(r)("Checkout")),9,Vr),s("button",{class:"directory-share-delete",type:"button",disabled:ee.value,onClick:We=>qs(y.remotePluginId)},i(pe.value===`delete:${y.remotePluginId}`?n(r)("Removing..."):n(r)("Remove")),9,Qr)]))),128))])),s("button",{class:"directory-action primary",type:"button",disabled:ee.value||!xt(),onClick:Hs},i(pe.value==="save"?n(r)("Sharing..."):n(r)("Share this plugin")),9,Wr)],64))])])])):u("",!0)])),(l(),re(st,{to:"body"},[de.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(Gt,["self"])},[s("article",Jr,[s("div",Yr,[s("div",Zr,[(tt=P.value)!=null&&tt.connector.logoUrl?(l(),o("img",{key:0,class:"directory-card-icon",src:P.value.connector.logoUrl,alt:P.value.connector.name,loading:"lazy"},null,8,Xr)):u("",!0),s("div",ec,[s("h3",tc,i(((Ht=P.value)==null?void 0:Ht.connector.name)||"Composio"),1),s("span",sc,i(P.value?It(P.value.connector):n(r)("Connector")),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close Composio detail"),onClick:Gt},i(n(r)("Close")),9,ac)]),s("div",lc,[Ce.value?(l(),o("div",oc,i(Ce.value),1)):qe.value?(l(),o("div",ic,"Loading connector...")):P.value?(l(),o(T,{key:2},[P.value.connector.description?(l(),o("p",nc,i(P.value.connector.description),1)):u("",!0),s("div",rc,[s("div",cc,[t[15]||(t[15]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",dc,[s("span",uc,i(P.value.connector.toolsCount)+" tools",1),P.value.connector.triggersCount>0?(l(),o("span",pc,i(P.value.connector.triggersCount)+" triggers",1)):u("",!0),P.value.connector.latestVersion?(l(),o("span",yc,"v"+i(P.value.connector.latestVersion),1)):u("",!0),P.value.connector.authModes.length>0?(l(),o("span",mc,i(P.value.connector.authModes.join(", ")),1)):u("",!0)])]),s("div",hc,[t[16]||(t[16]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),P.value.connections.length===0?(l(),o("div",vc," No linked accounts yet. ")):(l(),o("div",gc,[(l(!0),o(T,null,B(P.value.connections,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,[at(i(y.alias||y.wordId||y.id)+" ",1),s("span",{class:Y(["directory-auth-status",Is(y.status)])},i(As(y.status)),3)]),s("span",bc,i(y.authScheme||"Auth"),1)]))),128))]))])]),P.value.tools.length>0?(l(),o("div",kc,[t[17]||(t[17]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(l(!0),o(T,null,B(P.value.tools.slice(0,8),y=>(l(),o("div",{key:y.slug,class:"directory-include-row"},[s("span",null,i(y.name||y.slug),1),s("span",fc,i(y.slug),1)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",$c,[P.value?(l(),o("button",{key:0,class:"directory-action-link",type:"button",onClick:t[10]||(t[10]=y=>ne(P.value.dashboardUrl))}," Open dashboard ")):u("",!0),P.value&&pt(P.value.connector)?(l(),o("button",{key:1,class:"directory-action",type:"button",disabled:ve.value===P.value.connector.slug,onClick:t[11]||(t[11]=y=>Kt(P.value.connector))},i(ve.value===((qt=P.value)==null?void 0:qt.connector.slug)?"Opening...":pt(P.value.connector)),9,Cc)):u("",!0),P.value&&Ft(P.value.connector)?(l(),o("button",{key:2,class:"directory-action primary",type:"button",disabled:Le.value,onClick:t[12]||(t[12]=y=>Et(P.value.connector,P.value.connections))},i(p.tryInFlightKey===Mt(P.value.connector.slug)?"Starting...":"Try it!"),9,wc)):u("",!0)])])])):u("",!0)]))])}}});export{Pc as default};
2
+ import{e as be,f as l,i as o,j as s,F as T,l as B,n as Y,t as i,k as u,Q as ta,u as n,w as xe,p as Oe,ae as sa,v as lt,c as S,_ as ot,x as Ie,h as re,T as st,I as aa,r as m,H as zt,o as Yt,M as Zt,m as at,af as la,ag as oa,D as Vt,B as ia,z as na,s as ra,ah as ca,ai as da,aj as ua,ak as pa,al as ya,am as ma,an as ha,ao as va,ap as ga,aq as ba,ar as ka,as as fa,at as $a,au as Ca,av as wa,aw as Sa,ax as _a,ay as La,az as Pa,aA as Aa,aB as Ia,aC as Ma,aD as Fa,aE as Ea,aF as Ta,aG as Qt,aH as Ua}from"./index-Bcgrj03j.js";import{s as Da}from"./sanitizeHtml-Bd3No2dT.js";const Na={class:"directory-section"},xa={class:"directory-toolbar"},Oa=["value"],Ra={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},Ba=["onClick"],Ga={key:0,class:"directory-empty"},Ka={key:1,class:"directory-error"},ja={key:2,class:"directory-loading"},Ha={key:3,class:"directory-empty"},qa={key:4,class:"directory-grid"},za={class:"directory-card-top"},Va=["src","alt"],Qa={class:"directory-card-main"},Wa={class:"directory-card-title-row"},Ja={class:"directory-card-title"},Ya={key:0,class:"directory-badge is-muted"},Za={key:1,class:"directory-badge"},Xa={class:"directory-card-meta"},el={key:0,class:"directory-card-description"},tl={class:"directory-chip-row"},sl={key:0,class:"directory-chip"},al={class:"directory-card-actions"},ll=["disabled","onClick"],ol=["onClick"],il=["disabled","onClick"],nl=be({__name:"DirectoryAppsTab",props:{apps:{},searchQuery:{},sortMode:{},supportsApps:{type:Boolean},error:{},isLoading:{type:Boolean},actionId:{},tryInFlightKey:{},isTryActionInFlight:{type:Boolean},appLogoSrc:{type:Function},appMetaLabel:{type:Function},appTryKey:{type:Function},toggleApp:{type:Function},openExternalUrl:{type:Function},tryApp:{type:Function},disabledLabel:{},connectedLabel:{},enableLabel:{},disableLabel:{},manageLabel:{},loginLabel:{},tryLabel:{},startingLabel:{}},emits:["update:search-query","update:sort-mode"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>(l(),o("section",Na,[s("div",xa,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps",onInput:v[0]||(v[0]=c=>f("update:search-query",c.target.value))},null,40,Oa),s("div",Ra,[(l(),o(T,null,B(M,c=>s("button",{key:c.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===c.id}]),type:"button",onClick:p=>f("update:sort-mode",c.id)},i(c.label),11,Ba)),64))])]),a.supportsApps?a.error?(l(),o("div",Ka,i(a.error),1)):a.isLoading?(l(),o("div",ja,"Loading apps...")):a.apps.length===0?(l(),o("div",Ha,"No apps found.")):(l(),o("div",qa,[(l(!0),o(T,null,B(a.apps,c=>(l(),o("article",{key:c.id,class:"directory-card"},[s("div",za,[a.appLogoSrc(c)?(l(),o("img",{key:0,class:"directory-card-icon",src:a.appLogoSrc(c),alt:c.name,loading:"lazy"},null,8,Va)):u("",!0),s("div",Qa,[s("div",Wa,[s("span",Ja,i(c.name),1),c.isEnabled?c.isAccessible?(l(),o("span",Za,i(a.connectedLabel),1)):u("",!0):(l(),o("span",Ya,i(a.disabledLabel),1))]),s("span",Xa,i(a.appMetaLabel(c)),1)])]),c.description?(l(),o("p",el,i(c.description),1)):u("",!0),s("div",tl,[c.category?(l(),o("span",sl,i(c.category),1)):u("",!0),(l(!0),o(T,null,B(c.pluginDisplayNames.slice(0,2),p=>(l(),o("span",{key:p,class:"directory-chip"},i(p),1))),128))]),s("div",al,[s("button",{class:"directory-action",type:"button",disabled:a.actionId===c.id,onClick:p=>a.toggleApp(c)},i(c.isEnabled?a.disableLabel:a.enableLabel),9,ll),c.installUrl?(l(),o("button",{key:0,class:"directory-action-link",type:"button",onClick:p=>a.openExternalUrl(c.installUrl)},i(c.isAccessible?a.manageLabel:a.loginLabel),9,ol)):u("",!0),c.isAccessible&&c.isEnabled?(l(),o("button",{key:1,class:"directory-action",type:"button",disabled:a.isTryActionInFlight,onClick:p=>a.tryApp(c)},i(a.tryInFlightKey===a.appTryKey(c)?a.startingLabel:a.tryLabel),9,il)):u("",!0)])]))),128))])):(l(),o("div",Ga," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))]))}}),rl={class:"directory-section"},cl={class:"directory-toolbar"},dl=["value"],ul={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},pl=["onClick"],yl={key:0,class:"directory-error"},ml={key:1,class:"directory-loading"},hl={key:2,class:"directory-empty"},vl={class:"directory-empty-copy"},gl={class:"directory-card-actions"},bl=["disabled"],kl={key:3,class:"composio-preview"},fl={class:"composio-preview-hero"},$l={class:"composio-preview-actions"},Cl=["disabled"],wl={class:"composio-preview-grid"},Sl={class:"directory-card-top"},_l={class:"directory-card-main"},Ll={class:"directory-card-title-row"},Pl={class:"directory-card-title"},Al={class:"directory-badge is-muted"},Il={class:"directory-card-meta"},Ml={class:"directory-card-description"},Fl={class:"directory-chip-row"},El={key:4,class:"directory-section composio-section"},Tl={class:"directory-card directory-card-wide composio-status-card"},Ul={class:"directory-card-top"},Dl={class:"directory-card-main"},Nl={class:"directory-card-title-row"},xl={class:"directory-card-title"},Ol={class:"directory-badge"},Rl={class:"directory-card-meta"},Bl={class:"directory-card-description"},Gl={class:"directory-chip-row"},Kl={key:0,class:"directory-chip"},jl={key:1,class:"directory-chip"},Hl={key:2,class:"directory-chip"},ql={class:"directory-card-actions"},zl={key:0,class:"directory-empty"},Vl={key:1,class:"directory-grid"},Ql={class:"directory-card-top"},Wl=["src","alt"],Jl={class:"directory-card-main"},Yl={class:"directory-card-title-row"},Zl={class:"directory-card-title"},Xl={key:0,class:"directory-badge"},eo={key:1,class:"directory-badge"},to={class:"directory-card-meta"},so={key:0,class:"directory-card-description"},ao={class:"directory-chip-row"},lo={class:"directory-chip"},oo={key:0,class:"directory-chip"},io={key:1,class:"directory-chip"},no={class:"directory-card-actions"},ro=["onClick"],co=["disabled","onClick"],uo=["disabled","onClick"],po={key:2,class:"directory-section-actions"},yo=["disabled"],mo=be({__name:"DirectoryComposioTab",props:{composioStatus:{},searchQuery:{},sortMode:{},error:{},isLoadingComposio:{type:Boolean},isInstallingComposio:{type:Boolean},isStartingComposioLogin:{type:Boolean},visibleComposioConnectors:{},visibleComposioPreviewConnectors:{},workspaceSummary:{},connectorCount:{},total:{},hasMoreComposioConnectors:{type:Boolean},actionSlug:{},isTryActionInFlight:{type:Boolean},tryInFlightKey:{},composioMetaLabel:{type:Function},composioPrimaryActionLabel:{type:Function},canTryComposio:{type:Function},composioTryKey:{type:Function},openComposioDetail:{type:Function},runComposioPrimaryAction:{type:Function},tryComposio:{type:Function},installComposioCli:{type:Function},startComposioCliLogin:{type:Function},loadMoreComposio:{type:Function},openExternalUrl:{type:Function},workspaceLabel:{},connectedLabel:{},authenticatedLabel:{},noAuthLabel:{},previewLabel:{},openDashboardLabel:{},detailsLabel:{},installLabel:{},installingLabel:{},loginLabel:{},openingLabel:{},startingLabel:{},tryLabel:{},loadMoreLabel:{},loadingLabel:{}},emits:["update:search-query","update:sort-mode"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>{var c;return l(),o("section",rl,[s("div",cl,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors",onInput:v[0]||(v[0]=p=>f("update:search-query",p.target.value))},null,40,dl),s("div",ul,[(l(),o(T,null,B(M,p=>s("button",{key:p.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===p.id}]),type:"button",onClick:I=>f("update:sort-mode",p.id)},i(p.label),11,pl)),64))])]),a.error?(l(),o("div",yl,i(a.error),1)):a.isLoadingComposio?(l(),o("div",ml,"Loading Composio connectors...")):(c=a.composioStatus)!=null&&c.available?a.composioStatus.authenticated?(l(),o("div",El,[s("article",Tl,[s("div",Ul,[s("div",Dl,[s("div",Nl,[s("span",xl,i(a.workspaceLabel),1),s("span",Ol,i(a.connectedLabel),1)]),s("span",Rl,i(a.composioStatus.email||a.composioStatus.defaultOrgName||a.authenticatedLabel),1)])]),s("p",Bl,i(a.workspaceSummary),1),s("div",Gl,[a.composioStatus.defaultOrgName?(l(),o("span",Kl,i(a.composioStatus.defaultOrgName),1)):u("",!0),a.composioStatus.cliVersion?(l(),o("span",jl,"CLI "+i(a.composioStatus.cliVersion),1)):u("",!0),a.connectorCount?(l(),o("span",Hl," Showing "+i(a.connectorCount)+i(a.total?` / ${a.total}`:"")+" connectors ",1)):u("",!0)]),s("div",ql,[s("button",{class:"directory-action-link",type:"button",onClick:v[4]||(v[4]=p=>a.openExternalUrl(a.composioStatus.webUrl))},i(a.openDashboardLabel),1)])]),a.visibleComposioConnectors.length===0?(l(),o("div",zl,"No Composio connectors found.")):(l(),o("div",Vl,[(l(!0),o(T,null,B(a.visibleComposioConnectors,p=>(l(),o("article",{key:p.slug,class:"directory-card"},[s("div",Ql,[p.logoUrl?(l(),o("img",{key:0,class:"directory-card-icon",src:p.logoUrl,alt:p.name,loading:"lazy"},null,8,Wl)):u("",!0),s("div",Jl,[s("div",Yl,[s("span",Zl,i(p.name),1),p.activeCount>0?(l(),o("span",Xl,i(a.connectedLabel),1)):p.isNoAuth?(l(),o("span",eo,i(a.noAuthLabel),1)):u("",!0)]),s("span",to,i(a.composioMetaLabel(p)),1)])]),p.description?(l(),o("p",so,i(p.description),1)):u("",!0),s("div",ao,[s("span",lo,i(p.toolsCount)+" tools",1),p.triggersCount>0?(l(),o("span",oo,i(p.triggersCount)+" triggers",1)):u("",!0),p.authModes.length>0?(l(),o("span",io,i(p.authModes.join(", ")),1)):u("",!0)]),s("div",no,[s("button",{class:"directory-action",type:"button",onClick:I=>a.openComposioDetail(p.slug)},i(a.detailsLabel),9,ro),a.composioPrimaryActionLabel(p)?(l(),o("button",{key:0,class:"directory-action-link",type:"button",disabled:a.actionSlug===p.slug,onClick:I=>a.runComposioPrimaryAction(p)},i(a.actionSlug===p.slug?a.openingLabel:a.composioPrimaryActionLabel(p)),9,co)):u("",!0),a.canTryComposio(p)?(l(),o("button",{key:1,class:"directory-action primary",type:"button",disabled:a.isTryActionInFlight,onClick:I=>a.tryComposio(p)},i(a.tryInFlightKey===a.composioTryKey(p.slug)?a.startingLabel:a.tryLabel),9,uo)):u("",!0)])]))),128))])),a.hasMoreComposioConnectors?(l(),o("div",po,[s("button",{class:"directory-action",type:"button",disabled:a.isLoadingComposio,onClick:v[5]||(v[5]=(...p)=>a.loadMoreComposio&&a.loadMoreComposio(...p))},i(a.isLoadingComposio?a.loadingLabel:a.loadMoreLabel),9,yo)])):u("",!0)])):(l(),o("div",kl,[s("article",fl,[v[7]||(v[7]=s("div",{class:"composio-preview-copy"},[s("div",null,[s("p",{class:"composio-preview-kicker"},"Connector catalog preview"),s("h3",{class:"composio-preview-title"},"Connect everyday apps like Gmail, Calendar, Reddit, YouTube, and Drive."),s("p",{class:"composio-preview-text"}," Composio is installed locally. Login to browse the live catalog, connect your accounts, and try simple actions from this machine. ")])],-1)),s("div",$l,[s("button",{class:"directory-action primary",type:"button",disabled:a.isStartingComposioLogin,onClick:v[2]||(v[2]=(...p)=>a.startComposioCliLogin&&a.startComposioCliLogin(...p))},i(a.isStartingComposioLogin?a.openingLabel:a.loginLabel),9,Cl),s("button",{class:"directory-action-link",type:"button",onClick:v[3]||(v[3]=p=>a.openExternalUrl(a.composioStatus.webUrl||"https://dashboard.composio.dev/"))},i(a.openDashboardLabel),1)])]),s("div",wl,[(l(!0),o(T,null,B(a.visibleComposioPreviewConnectors,p=>(l(),o("article",{key:p.slug,class:"directory-card composio-preview-card"},[s("div",Sl,[s("div",_l,[s("div",Ll,[s("span",Pl,i(p.name),1),s("span",Al,i(a.previewLabel),1)]),s("span",Il,i(p.meta),1)])]),s("p",Ml,i(p.description),1),s("div",Fl,[(l(!0),o(T,null,B(p.chips,I=>(l(),o("span",{key:I,class:"directory-chip"},i(I),1))),128))])]))),128))])])):(l(),o("div",hl,[s("div",vl,[v[6]||(v[6]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",gl,[s("button",{class:"directory-action primary",type:"button",disabled:a.isInstallingComposio,onClick:v[1]||(v[1]=(...p)=>a.installComposioCli&&a.installComposioCli(...p))},i(a.isInstallingComposio?a.installingLabel:a.installLabel),9,bl)])])]))])}}}),ho={class:"directory-section"},vo={class:"directory-toolbar"},go=["value"],bo={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},ko=["onClick"],fo={key:0,class:"directory-marketplace"},$o={class:"directory-marketplace-header"},Co=["disabled"],wo={key:0,class:"directory-marketplace-empty"},So={key:1,class:"directory-marketplace-list"},_o={class:"directory-marketplace-name"},Lo={key:0,class:"directory-marketplace-path"},Po=["disabled","onClick"],Ao={class:"directory-marketplace-add"},Io=["value"],Mo=["disabled"],Fo={key:1,class:"directory-empty"},Eo={key:2,class:"directory-error"},To={key:3,class:"directory-loading"},Uo={key:4,class:"directory-empty"},Do={key:5,class:"directory-grid"},No=["onClick"],xo={class:"directory-card-top"},Oo=["src","alt"],Ro={class:"directory-card-main"},Bo={class:"directory-card-title-row"},Go={class:"directory-card-title"},Ko={key:0,class:"directory-badge is-muted"},jo={key:1,class:"directory-badge"},Ho={class:"directory-card-meta"},qo={key:0,class:"directory-card-description"},zo={class:"directory-chip-row"},Vo={key:0,class:"directory-chip"},Qo=be({__name:"DirectoryPluginsTab",props:{plugins:{},searchQuery:{},sortMode:{},supportsPlugins:{type:Boolean},supportsMarketplace:{type:Boolean},error:{},isLoading:{type:Boolean},marketplaces:{},marketplaceSourceUrl:{},marketplaceActionName:{},isMarketplaceActionInFlight:{type:Boolean},pluginIconSrc:{type:Function},openPluginDetail:{type:Function},addMarketplace:{type:Function},removeMarketplace:{type:Function},upgradeAllMarketplaces:{type:Function},disabledLabel:{},installedLabel:{},pluginLabel:{},upgradeAllLabel:{},upgradingLabel:{},removingLabel:{},removeLabel:{},addingLabel:{},addLabel:{}},emits:["update:search-query","update:sort-mode","update:marketplace-source-url"],setup(a,{emit:N}){const f=N,M=[{id:"popular",label:"Popular"},{id:"name",label:"A-Z"},{id:"date",label:"Date"}];return(_,v)=>(l(),o("section",ho,[s("div",vo,[s("input",{value:a.searchQuery,class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins",onInput:v[0]||(v[0]=c=>f("update:search-query",c.target.value))},null,40,go),s("div",bo,[(l(),o(T,null,B(M,c=>s("button",{key:c.id,class:Y(["directory-sort-button",{"is-active":a.sortMode===c.id}]),type:"button",onClick:p=>f("update:sort-mode",c.id)},i(c.label),11,ko)),64))])]),a.supportsMarketplace?(l(),o("div",fo,[s("div",$o,[v[5]||(v[5]=s("span",{class:"directory-marketplace-title"},"Marketplaces",-1)),s("button",{class:"directory-marketplace-upgrade",type:"button",disabled:a.isMarketplaceActionInFlight,onClick:v[1]||(v[1]=(...c)=>a.upgradeAllMarketplaces&&a.upgradeAllMarketplaces(...c))},i(a.marketplaceActionName==="upgrade"?a.upgradingLabel:a.upgradeAllLabel),9,Co)]),a.marketplaces.length===0?(l(),o("div",wo,"No marketplaces configured.")):(l(),o("div",So,[(l(!0),o(T,null,B(a.marketplaces,c=>(l(),o("div",{key:c.name,class:"directory-marketplace-row"},[s("span",_o,i(c.displayName),1),c.path?(l(),o("code",Lo,i(c.path),1)):u("",!0),s("button",{class:"directory-marketplace-remove",type:"button",disabled:a.isMarketplaceActionInFlight,onClick:p=>a.removeMarketplace(c.name)},i(a.marketplaceActionName===`remove:${c.name}`?a.removingLabel:a.removeLabel),9,Po)]))),128))])),s("div",Ao,[s("input",{value:a.marketplaceSourceUrl,class:"directory-marketplace-source",type:"url",placeholder:"Git URL to add a marketplace","aria-label":"Marketplace Git URL",onInput:v[2]||(v[2]=c=>f("update:marketplace-source-url",c.target.value)),onKeydown:v[3]||(v[3]=ta((...c)=>a.addMarketplace&&a.addMarketplace(...c),["enter"]))},null,40,Io),s("button",{class:"directory-marketplace-add-button",type:"button",disabled:a.isMarketplaceActionInFlight||!a.marketplaceSourceUrl.trim(),onClick:v[4]||(v[4]=(...c)=>a.addMarketplace&&a.addMarketplace(...c))},i(a.marketplaceActionName==="add"?a.addingLabel:a.addLabel),9,Mo)])])):u("",!0),a.supportsPlugins?a.error?(l(),o("div",Eo,i(a.error),1)):a.isLoading?(l(),o("div",To,"Loading plugins...")):a.plugins.length===0?(l(),o("div",Uo,"No plugins found.")):(l(),o("div",Do,[(l(!0),o(T,null,B(a.plugins,c=>(l(),o("button",{key:c.id,class:Y(["directory-card",{"is-disabled":c.installed&&!c.enabled}]),type:"button",onClick:p=>a.openPluginDetail(c)},[s("div",xo,[a.pluginIconSrc(c)?(l(),o("img",{key:0,class:"directory-card-icon",src:a.pluginIconSrc(c),alt:c.displayName,loading:"lazy"},null,8,Oo)):u("",!0),s("div",Ro,[s("div",Bo,[s("span",Go,i(c.displayName),1),c.installed&&!c.enabled?(l(),o("span",Ko,i(a.disabledLabel),1)):c.installed?(l(),o("span",jo,i(a.installedLabel),1)):u("",!0)]),s("span",Ho,i(c.developerName||c.marketplaceDisplayName||c.marketplaceName||a.pluginLabel),1)])]),c.description?(l(),o("p",qo,i(c.description),1)):u("",!0),s("div",zo,[c.category?(l(),o("span",Vo,i(c.category),1)):u("",!0),(l(!0),o(T,null,B(c.capabilities.slice(0,2),p=>(l(),o("span",{key:p,class:"directory-chip"},i(p),1))),128))])],10,No))),128))])):(l(),o("div",Fo," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))]))}}),Wo={class:"skill-card-top"},Jo=["src","alt"],Yo={class:"skill-card-info"},Zo={class:"skill-card-header"},Xo={class:"skill-card-name"},ei={key:0,class:"skill-card-badge-disabled"},ti={key:1,class:"skill-card-badge"},si={key:0,class:"skill-card-owner"},ai=["title"],li={key:0,class:"skill-card-desc"},oi={key:1,class:"skill-card-meta-row"},ii=be({__name:"SkillCard",props:{skill:{},showStatusBadge:{type:Boolean,default:!0},showBrowseAction:{type:Boolean,default:!0},showOwner:{type:Boolean,default:!0}},emits:["select"],setup(a){const N=a,{t:f}=lt(),M=S(()=>N.showStatusBadge!==!1),_=S(()=>N.showBrowseAction!==!1),v=S(()=>N.showOwner!==!1),c=S(()=>{const r=N.skill.path;return r?r.endsWith("/SKILL.md")?r.slice(0,-9):r:""});function p(){const r=c.value;r&&window.open(`/codex-local-browse${encodeURI(r)}`,"_blank","noopener,noreferrer")}const I=S(()=>{const r=N.skill.publishedAt;if(!r)return"";const G=new Date(r),z=Date.now()-r;return z<36e5?`${Math.floor(z/6e4)}${f("ago")}`:z<864e5?`${Math.floor(z/36e5)}${f("ago")}`:z<2592e6?`${Math.floor(z/864e5)}${f("ago")}`:G.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),x=S(()=>{const r=[];return N.skill.installCountLabel&&r.push(N.skill.installCountLabel),I.value&&r.push(I.value),r});function H(r){const G=r.target;G.style.display="none"}return(r,G)=>(l(),o("button",{class:Y(["skill-card",{"is-disabled":a.skill.installed&&a.skill.enabled===!1}]),type:"button",onClick:G[0]||(G[0]=q=>r.$emit("select",a.skill))},[s("div",Wo,[a.skill.avatarUrl?(l(),o("img",{key:0,class:"skill-card-avatar",src:a.skill.avatarUrl,alt:a.skill.owner,loading:"lazy",onError:H},null,40,Jo)):u("",!0),s("div",Yo,[s("div",Zo,[s("span",Xo,i(a.skill.displayName||a.skill.name),1),M.value?(l(),o(T,{key:0},[a.skill.installed&&a.skill.enabled===!1?(l(),o("span",ei,i(n(f)("Disabled")),1)):a.skill.installed?(l(),o("span",ti,i(n(f)("Installed")),1)):u("",!0)],64)):u("",!0)]),v.value?(l(),o("span",si,i(a.skill.owner),1)):u("",!0)]),_.value&&a.skill.installed&&c.value?(l(),o("button",{key:1,class:"skill-card-browse",type:"button",title:n(f)("Browse files"),onClick:xe(p,["stop"])},[Oe(sa,{class:"skill-card-browse-icon"})],8,ai)):u("",!0)]),a.skill.description?(l(),o("p",li,i(a.skill.description),1)):u("",!0),x.value.length>0?(l(),o("div",oi,[(l(!0),o(T,null,B(x.value,q=>(l(),o("span",{key:q,class:"skill-card-meta"},i(q),1))),128))])):u("",!0)],2))}}),Wt=ot(ii,[["__scopeId","data-v-cb7845c3"]]),ni={class:"sdm-panel"},ri={class:"sdm-header"},ci={class:"sdm-title-area"},di=["src","alt"],ui={class:"sdm-title-col"},pi={class:"sdm-title-row"},yi={class:"sdm-title"},mi={key:0,class:"sdm-badge-disabled"},hi={class:"sdm-owner"},vi=["aria-label"],gi={class:"sdm-body"},bi={key:0,class:"sdm-desc"},ki={key:1,class:"sdm-readme-loading"},fi=["innerHTML"],$i=["href"],Ci={class:"sdm-footer"},wi={class:"sdm-footer-actions"},Si=["disabled"],_i=["disabled"],Li=["disabled"],Pi=["disabled"],Ai=be({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(a,{emit:N}){const f=a,M=N,_=m(null),v=m(""),c=m(""),p=m(!1),{t:I}=lt(),x=S(()=>_.value??f.skill.enabled??!0),H=S(()=>f.isInstalling===!0||f.isUninstalling===!0),r=S(()=>v.value||f.skill.description),G=S(()=>{const A=f.skill.path;return A?A.endsWith("/SKILL.md")?A.slice(0,-9):A:""}),q=S(()=>{const A=c.value;if(!A)return"";const D=A.replace(/^---[\s\S]*?---\s*/,"");return Da(z(D))});function z(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function te(){if(!(!f.skill.owner||!f.skill.name)){p.value=!0,v.value="",c.value="";try{const A=new URLSearchParams({owner:f.skill.owner,name:f.skill.name});f.skill.installed&&A.set("installed","true"),f.skill.path&&A.set("path",f.skill.path);const D=await fetch(`/codex-api/skills-hub/readme?${A}`);if(!D.ok)return;const K=await D.json();c.value=K.content??"",v.value=K.description??""}catch{}finally{p.value=!1}}}Ie(()=>f.visible,A=>{A&&(_.value=null,v.value="",c.value="",te())});function F(){M("install",f.skill)}function $(){M("uninstall",f.skill)}function w(){const A=!x.value;_.value=A,M("toggle-enabled",f.skill,A)}function k(){f.isTrying||M("try",f.skill)}function V(){const A=G.value;A&&window.open(`/codex-local-browse${encodeURI(A)}`,"_blank","noopener,noreferrer")}return(A,D)=>(l(),re(st,{to:"body"},[a.visible?(l(),o("div",{key:0,class:"sdm-overlay",onClick:D[1]||(D[1]=xe(K=>A.$emit("close"),["self"]))},[s("div",ni,[s("div",ri,[s("div",ci,[a.skill.avatarUrl?(l(),o("img",{key:0,class:"sdm-avatar",src:a.skill.avatarUrl,alt:a.skill.owner,loading:"lazy"},null,8,di)):u("",!0),s("div",ui,[s("div",pi,[s("h3",yi,i(a.skill.displayName||a.skill.name),1),a.skill.installed&&!x.value?(l(),o("span",mi,i(n(I)("Disabled")),1)):u("",!0)]),s("span",hi,i(a.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":n(I)("Close"),onClick:D[0]||(D[0]=K=>A.$emit("close"))},[Oe(aa,{class:"sdm-close-icon"})],8,vi)]),s("div",gi,[r.value?(l(),o("p",bi,i(r.value),1)):u("",!0),p.value?(l(),o("div",ki,i(n(I)("Loading skill contents...")),1)):c.value?(l(),o("div",{key:2,class:"sdm-readme",innerHTML:q.value},null,8,fi)):u("",!0),a.skill.url?(l(),o("a",{key:3,class:"sdm-link",href:a.skill.url,target:"_blank",rel:"noopener noreferrer"},i(n(I)("View on GitHub")),9,$i)):u("",!0)]),s("div",Ci,[s("div",wi,[a.skill.installed?(l(),o("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:H.value,onClick:$},i(f.isUninstalling?n(I)("Uninstalling..."):n(I)("Uninstall")),9,Si)):(l(),o("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:H.value,onClick:F},i(f.isInstalling?n(I)("Installing..."):n(I)("Install")),9,_i)),a.skill.installed?(l(),o("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:H.value,onClick:w},i(x.value?n(I)("Disable"):n(I)("Enable")),9,Li)):u("",!0),a.skill.installed&&x.value?(l(),o("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:H.value||f.isTrying,onClick:k},i(f.isTrying?"Starting...":"Try it!"),9,Pi)):u("",!0),a.skill.installed&&G.value?(l(),o("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:V},i(n(I)("Browse files")),1)):u("",!0)])])])])):u("",!0)]))}}),Ii=ot(Ai,[["__scopeId","data-v-149eac3d"]]),Mi={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};let mt=null;function Fi(){return mt||(mt=Promise.all([zt(()=>import("./index.esm-Cxn_LBGD.js"),__vite__mapDeps([0,1])),zt(()=>import("./index.esm-DYMAm9mq.js"),__vite__mapDeps([2,1]))])),mt}function Ei(a){const N=m(null),f=m(""),M=m(""),_=m(""),v=m({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),c=S(()=>_.value==="pull"),p=S(()=>_.value==="push"),I=S(()=>_.value==="startup-sync"),x=S(()=>_.value!=="");async function H(){try{const $=await fetch("/codex-api/skills-sync/status");if(!$.ok)return;const w=await $.json();w.data&&(v.value=w.data)}catch{}}async function r(){try{const $=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),w=await $.json();if(!$.ok||!w.data)throw new Error("Failed to start GitHub login");N.value=w.data;const k=30,V=Math.max((w.data.interval??5)*1e3,3e3);let A=!1;for(let D=0;D<k;D++){await new Promise(X=>setTimeout(X,V));const K=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:w.data.device_code})}),Q=await K.json();if(!K.ok)throw new Error(Q.error||"Failed to complete GitHub login");if(Q.ok){A=!0;break}if(!Q.pending)throw new Error(Q.error||"Failed to complete GitHub login")}if(!A)throw new Error("GitHub login timed out. Please retry.");N.value=null,await H(),a.showToast("GitHub login successful")}catch($){a.showToast($ instanceof Error?$.message:"Failed GitHub login","error")}}async function G(){try{const[$,w]=await Fi(),{getApp:k,getApps:V,initializeApp:A}=$,{getAuth:D,GithubAuthProvider:K,signInWithPopup:Q}=w,X=V().length>0?k():A(Mi),me=D(X),se=new K;se.addScope("repo");const ke=await Q(me,se),ae=K.credentialFromResult(ke),le=(ae==null?void 0:ae.accessToken)??"";if(!le)throw new Error("GitHub access token missing from Firebase login");const Z=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:le})}),W=await Z.json();if(!Z.ok||!W.ok)throw new Error(W.error||"Failed to login with GitHub token");await H(),a.showToast("GitHub login successful")}catch($){const w=$ instanceof Error?$.message:"Failed Firebase GitHub login";a.showToast(w,"error")}}async function q(){M.value="",f.value="pull-started",_.value="pull";try{const $=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to pull synced skills");await a.onPulled(),f.value="pull-success",a.showToast(v.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch($){const w=$ instanceof Error?$.message:"Failed to pull sync";M.value=w,f.value="pull-failed",a.showToast(w,"error")}finally{_.value=""}}async function z(){M.value="",f.value="push-started",_.value="push";try{const $=await fetch("/codex-api/skills-sync/push",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to push synced skills");f.value="push-success",a.showToast("Pushed skills to private sync repo")}catch($){const w=$ instanceof Error?$.message:"Failed to push sync";M.value=w,f.value="push-failed",a.showToast(w,"error")}finally{_.value=""}}async function te(){M.value="",f.value="startup-sync-started",_.value="startup-sync";try{const $=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to run startup sync");await a.onPulled(),await H(),f.value="startup-sync-success",a.showToast("Startup sync completed")}catch($){const w=$ instanceof Error?$.message:"Failed startup sync";M.value=w,f.value="startup-sync-failed",a.showToast(w,"error")}finally{_.value=""}}async function F(){try{const $=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),w=await $.json();if(!$.ok||!w.ok)throw new Error(w.error||"Failed to logout GitHub");await H(),a.showToast("Logged out from GitHub")}catch($){a.showToast($ instanceof Error?$.message:"Failed to logout GitHub","error")}}return{deviceLogin:N,isPullInFlight:c,isPushInFlight:p,isStartupSyncInFlight:I,isSyncActionInFlight:x,loadSyncStatus:H,logoutGithub:F,pullSkillsSync:q,pushSkillsSync:z,startupSkillsSync:te,startGithubFirebaseLogin:G,startGithubLogin:r,syncActionError:M,syncActionStatus:f,syncStatus:v}}const Ti={class:"skills-hub"},Ui={class:"skills-hub-header"},Di={class:"skills-hub-title"},Ni={class:"skills-hub-subtitle"},xi={class:"skills-sync-panel"},Oi={class:"skills-sync-header"},Ri=["href"],Bi={key:1,class:"skills-sync-badge"},Gi={key:2,class:"skills-sync-badge"},Ki={class:"skills-sync-meta"},ji={key:0,class:"skills-sync-error"},Hi=["href"],qi={key:1,class:"skills-sync-meta"},zi={key:2,class:"skills-sync-error"},Vi=["href"],Qi={key:3,class:"skills-sync-device"},Wi=["href"],Ji={class:"skills-sync-actions"},Yi=["disabled"],Zi=["disabled"],Xi=["disabled"],en=["disabled"],tn={class:"skills-search-panel"},sn={class:"skills-search-header"},an={class:"skills-search-copy"},ln={class:"skills-directory-link",href:"https://skills.anyclaw.store/",target:"_blank",rel:"noopener noreferrer"},on=["placeholder","aria-label"],nn=["disabled"],rn={key:0,class:"skills-hub-error"},cn=["href"],dn={key:1,class:"skills-hub-section"},un={class:"skills-hub-section-title"},pn={key:0,class:"skills-hub-grid"},yn={key:2,class:"skills-hub-section"},mn={class:"skills-hub-section-title"},hn={key:0,class:"skills-hub-grid"},vn={class:"skills-hub-section"},gn={key:0,class:"skills-hub-loading"},bn={key:1,class:"skills-hub-error"},kn=["href"],fn={key:2,class:"skills-hub-empty"},$n=be({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(a,{emit:N}){const f={name:"",owner:"",description:"",url:"",installed:!1},M=m([]),_=m([]),v=m(!1),c=m(!1),p=m(""),I=m(""),x=m(""),H=m(!0),r=m(!0),G=m(!1),q=m(f),z=m(null),te=m(""),F=m(!1),$=m(!1);let w=null;Yt(()=>{w&&clearTimeout(w)});const{t:k}=lt(),{buildFeedbackMailto:V,feedbackMailtoBase:A,recordVisibleFailure:D}=na(),K=A(),Q=a,X=N,me=S(()=>{var g;return((g=z.value)==null?void 0:g.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),se=S(()=>`${q.value.owner}/${q.value.name}`),ke=S(()=>F.value&&te.value===se.value),ae=S(()=>$.value&&te.value===se.value),le=S(()=>{if(!O.value.configured)return"";const g=O.value.repoOwner.trim(),h=O.value.repoName.trim();return!g||!h?"":`https://github.com/${encodeURIComponent(g)}/${encodeURIComponent(h)}`}),Z=S(()=>M.value);function W(g,h="success"){z.value={text:g,type:h},w&&clearTimeout(w),w=setTimeout(()=>{z.value=null},3e3)}function he(g,h){D(h);const b=g.currentTarget;b instanceof HTMLAnchorElement&&(b.href=V())}function fe(g){if(M.value=g.installed??[],_.value.length>0){const h=new Map(M.value.map(b=>[b.name,b]));_.value=_.value.map(b=>{const R=h.get(b.name);return R?Me(b,R):b})}}function Me(g,h){return{...g,installed:!0,path:h.path,enabled:h.enabled}}function Re(g,h){return{...g,installed:!0,source:h.source,publishedAt:h.publishedAt}}async function ce(){v.value=!0,p.value="";try{const g=await fetch("/codex-api/skills-hub");if(!g.ok)throw new Error(`HTTP ${g.status}`);const h=await g.json();fe(h)}catch(g){p.value=g instanceof Error?g.message:k("Failed to load skills")}finally{v.value=!1}}function Fe(g){const h=g.installed?M.value.find(b=>b.name===g.name):void 0;q.value=h?Re(h,g):g,G.value=!0}async function Be(){const g=I.value.trim();if(!(g.length<2)){c.value=!0,x.value="";try{const h=new URLSearchParams({q:g}),b=await fetch(`/codex-api/skills-hub/search?${h}`),R=await b.json();if(!b.ok)throw new Error(R.error||`HTTP ${b.status}`);const oe=new Map(M.value.map(ie=>[ie.name,ie]));_.value=(R.results??[]).map(ie=>{const ee=oe.get(ie.name);return ee?Me(ie,ee):ie}),r.value=!0,_.value.length===0&&W(k("No matching skills found."),"error")}catch(h){x.value=h instanceof Error?h.message:k("Failed to search skills")}finally{c.value=!1}}}async function Ge(g){te.value=`${g.owner}/${g.name}`,F.value=!0;try{const b=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:g.owner,name:g.name,source:g.source})})).json();if(!b.ok)throw new Error(b.error||k("Install failed"));if(!b.path)throw new Error(k("Install completed but no local skill path was returned"));await ce();const R=M.value.find(oe=>oe.name===g.name);if(!(R!=null&&R.path))throw new Error(k("Install completed but the local skill was not found after refresh"));q.value=Re(R,g),W(`${g.displayName||g.name} ${k("skill installed")}`),G.value=!1,X("skills-changed")}catch(h){W(h instanceof Error?h.message:k("Failed to install skill"),"error")}finally{F.value=!1}}async function Ke(g){te.value=`${g.owner}/${g.name}`,$.value=!0;try{const b=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g.name,path:g.path})})).json();if(!b.ok)throw new Error(b.error||k("Uninstall failed"));M.value=M.value.filter(R=>R.name!==g.name),W(`${g.displayName||g.name} ${k("skill uninstalled")}`),G.value=!1,X("skills-changed")}catch(h){W(h instanceof Error?h.message:k("Failed to uninstall skill"),"error")}finally{$.value=!1}}async function je(g,h){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:g.path,enabled:h}})})).ok)throw new Error(k("Failed to update skill"));await fetch("/codex-api/skills-sync/push",{method:"POST"}),W(`${g.displayName||g.name} ${k("skill")} ${k(h?"enabled":"disabled")}`),await ce()}catch(b){W(b instanceof Error?b.message:k("Failed to update skill"),"error")}}function L(g){!g.installed||g.enabled===!1||Q.tryInFlightKey||(X("try-item",{kind:"skill",name:g.name,displayName:g.displayName||g.name,skillPath:g.path}),G.value=!1)}function U(g){return`skill:${g.name}:${g.path??""}`}const{deviceLogin:$e,isPullInFlight:He,isPushInFlight:Ee,isStartupSyncInFlight:P,isSyncActionInFlight:de,loadSyncStatus:qe,logoutGithub:Ce,pullSkillsSync:Te,pushSkillsSync:Ue,startupSkillsSync:J,startGithubFirebaseLogin:De,startGithubLogin:ve,syncActionError:ue,syncActionStatus:we,syncStatus:O}=Ei({showToast:W,onPulled:async()=>{await ce(),X("skills-changed")}}),Se=[S(()=>O.value.startup.lastError),ue,x,p];return Zt(()=>{ce(),qe()}),Ie(Se,(g,h)=>{g.forEach((b,R)=>{if(b===h[R])return;const oe=b.trim();oe&&D(oe)})}),(g,h)=>(l(),o("div",Ti,[s("div",Ui,[s("h2",Di,i(n(k)("Skills Hub")),1),s("p",Ni,i(n(k)("Manage installed skills on this machine")),1)]),s("div",xi,[s("div",Oi,[s("strong",null,i(n(k)("Skills Sync (GitHub)")),1),n(O).configured&&le.value?(l(),o("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:le.value,target:"_blank",rel:"noopener noreferrer"},i(n(k)("Connected"))+": "+i(n(O).repoOwner)+"/"+i(n(O).repoName),9,Ri)):n(O).loggedIn?(l(),o("span",Bi,i(n(k)("Logged in as"))+" "+i(n(O).githubUsername),1)):(l(),o("span",Gi,i(n(k)("Not connected")),1))]),s("div",Ki,[s("span",null,i(n(k)("Startup"))+": "+i(n(O).startup.mode),1),s("span",null,i(n(k)("Branch"))+": "+i(n(O).startup.branch),1),s("span",null,i(n(k)("Action"))+": "+i(n(O).startup.lastAction),1)]),n(O).startup.lastError?(l(),o("div",ji,[s("span",null,i(n(O).startup.lastError),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[0]||(h[0]=b=>he(b,n(O).startup.lastError))},i(n(k)("Send feedback")),9,Hi)])):u("",!0),n(we)?(l(),o("div",qi,[s("span",null,i(n(k)("Manual sync"))+": "+i(n(we)),1)])):u("",!0),n(ue)?(l(),o("div",zi,[s("span",null,i(n(ue)),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[1]||(h[1]=b=>he(b,n(ue)))},i(n(k)("Send feedback")),9,Vi)])):u("",!0),n($e)?(l(),o("div",Qi,[s("span",null,[at(i(n(k)("Open"))+" ",1),s("a",{href:n($e).verification_uri,target:"_blank",rel:"noreferrer"},i(n(k)("GitHub device login")),9,Wi),at(" "+i(n(k)("and enter code:")),1)]),s("code",null,i(n($e).user_code),1)])):u("",!0),s("div",Ji,[n(O).loggedIn?u("",!0):(l(),o("button",{key:0,class:"skills-hub-sort",type:"button",onClick:h[2]||(h[2]=(...b)=>n(De)&&n(De)(...b))},i(n(k)("Login with GitHub")),1)),n(O).loggedIn?u("",!0):(l(),o("button",{key:1,class:"skills-hub-sort",type:"button",onClick:h[3]||(h[3]=(...b)=>n(ve)&&n(ve)(...b))},i(n(k)("Device Login")),1)),n(O).loggedIn?(l(),o("button",{key:2,class:"skills-hub-sort",type:"button",onClick:h[4]||(h[4]=(...b)=>n(Ce)&&n(Ce)(...b)),disabled:n(de)},i(n(k)("Logout GitHub")),9,Yi)):u("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:h[5]||(h[5]=(...b)=>n(J)&&n(J)(...b)),disabled:n(de)},i(n(P)?n(k)("Syncing..."):n(k)("Startup Sync")),9,Zi),s("button",{class:"skills-hub-sort",type:"button",onClick:h[6]||(h[6]=(...b)=>n(Te)&&n(Te)(...b)),disabled:n(de)},i(n(He)?n(k)("Pulling..."):n(k)("Pull")),9,Xi),n(O).loggedIn?(l(),o("button",{key:3,class:"skills-hub-sort",type:"button",onClick:h[7]||(h[7]=(...b)=>n(Ue)&&n(Ue)(...b)),disabled:!n(O).configured||n(de)},i(n(Ee)?n(k)("Pushing..."):n(k)("Push")),9,en)):u("",!0)])]),z.value?(l(),o("div",{key:0,class:Y(["skills-hub-toast",me.value])},i(z.value.text),3)):u("",!0),s("div",tn,[s("div",sn,[s("div",an,[s("strong",null,i(n(k)("Find skills")),1),s("span",null,i(n(k)("Search the Skills registry with npx skills find.")),1)]),s("a",ln,i(n(k)("Skills directory")),1)]),s("form",{class:"skills-search-form",onSubmit:xe(Be,["prevent"])},[la(s("input",{"onUpdate:modelValue":h[8]||(h[8]=b=>I.value=b),class:"skills-search-input",type:"search",placeholder:n(k)("Search skills..."),"aria-label":n(k)("Search skills")},null,8,on),[[oa,I.value]]),s("button",{class:"skills-hub-sort",type:"submit",disabled:c.value||I.value.trim().length<2},i(c.value?n(k)("Searching..."):n(k)("Search")),9,nn)],32),x.value?(l(),o("div",rn,[s("span",null,i(x.value),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[9]||(h[9]=b=>he(b,x.value))},i(n(k)("Send feedback")),9,cn)])):u("",!0)]),_.value.length>0?(l(),o("div",dn,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:h[10]||(h[10]=b=>r.value=!r.value)},[s("span",un,i(n(k)("Search results ({count})",{count:_.value.length})),1),Oe(Vt,{class:Y(["skills-hub-section-chevron",{"is-open":r.value}])},null,8,["class"])]),r.value?(l(),o("div",pn,[(l(!0),o(T,null,B(_.value,b=>(l(),re(Wt,{key:b.source||`${b.owner}/${b.name}`,skill:b,"show-browse-action":!1,onSelect:R=>Fe(R)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),ia(g.$slots,"before-installed",{},void 0),Z.value.length>0?(l(),o("div",yn,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:h[11]||(h[11]=b=>H.value=!H.value)},[s("span",mn,i(n(k)("Installed skills ({count})",{count:Z.value.length})),1),Oe(Vt,{class:Y(["skills-hub-section-chevron",{"is-open":H.value}])},null,8,["class"])]),H.value?(l(),o("div",hn,[(l(!0),o(T,null,B(Z.value,b=>(l(),re(Wt,{key:b.name,skill:b,"show-status-badge":!1,"show-owner":!1,onSelect:R=>Fe(R)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),s("div",vn,[v.value?(l(),o("div",gn,i(n(k)("Loading skills...")),1)):p.value?(l(),o("div",bn,[s("span",null,i(p.value),1),s("a",{class:"skills-error-feedback",href:n(K),onClick:h[12]||(h[12]=b=>he(b,p.value))},i(n(k)("Send feedback")),9,kn)])):M.value.length===0?(l(),o("div",fn,i(n(k)("No installed skills found.")),1)):u("",!0)]),Oe(Ii,{skill:q.value,visible:G.value,"is-installing":ke.value,"is-uninstalling":ae.value,"is-trying":Q.tryInFlightKey===U(q.value),onClose:h[13]||(h[13]=b=>G.value=!1),onInstall:Ge,onUninstall:Ke,onToggleEnabled:je,onTry:L},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),Cn=ot($n,[["__scopeId","data-v-513a5347"]]),wn={class:"directory-section"},Sn={class:"skills-embedded-section"},_n={class:"skills-embedded-title"},Ln={key:0,class:"skills-embedded-body"},Pn={key:0,class:"directory-empty"},An={key:1,class:"directory-error"},In={key:2,class:"directory-loading"},Mn={key:3,class:"directory-empty"},Fn={key:4,class:"mcp-skill-grid"},En=["onClick"],Tn={class:"mcp-skill-card-top"},Un={class:"mcp-skill-info"},Dn={class:"mcp-skill-header"},Nn={class:"mcp-skill-name"},xn={class:"mcp-skill-meta"},On={key:0,class:"directory-mcp-detail"},Rn={key:0},Bn={class:"directory-mini-list"},Gn={key:1},Kn={class:"directory-mini-list"},jn=be({__name:"DirectorySkillsTab",props:{tryInFlightKey:{},supportsMcps:{type:Boolean},mcpError:{},isLoadingMcps:{type:Boolean},visibleMcpServers:{},isMcpSectionOpen:{type:Boolean},expandedMcpNames:{},formatMcpAuthStatus:{type:Function},mcpCardBadgeClass:{type:Function},toggleMcpSectionOpen:{type:Function},toggleMcpExpanded:{type:Function}},emits:["skills-changed","try-item"],setup(a,{emit:N}){const f=N;return(M,_)=>(l(),o("section",wn,[Oe(Cn,{"try-in-flight-key":a.tryInFlightKey,onSkillsChanged:_[1]||(_[1]=v=>f("skills-changed")),onTryItem:_[2]||(_[2]=v=>f("try-item",v))},{"before-installed":ra(()=>[s("div",Sn,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:_[0]||(_[0]=(...v)=>a.toggleMcpSectionOpen&&a.toggleMcpSectionOpen(...v))},[s("span",_n,"MCPs("+i(a.visibleMcpServers.length)+")",1),s("span",{class:Y(["skills-embedded-chevron",{"is-open":a.isMcpSectionOpen}])},"›",2)]),a.isMcpSectionOpen?(l(),o("div",Ln,[a.supportsMcps?a.mcpError?(l(),o("div",An,i(a.mcpError),1)):a.isLoadingMcps?(l(),o("div",In,"Loading MCP servers...")):a.visibleMcpServers.length===0?(l(),o("div",Mn,"No MCP servers configured.")):(l(),o("div",Fn,[(l(!0),o(T,null,B(a.visibleMcpServers,v=>(l(),o("article",{key:v.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:c=>a.toggleMcpExpanded(v.name)},[s("div",Tn,[s("div",Un,[s("div",Dn,[s("span",Nn,i(v.name),1),s("span",{class:Y(["mcp-skill-badge",a.mcpCardBadgeClass(v.authStatus)])},i(a.formatMcpAuthStatus(v.name)),3)]),_[3]||(_[3]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:Y(["mcp-skill-chevron",{"is-open":a.expandedMcpNames.has(v.name)}])},"›",2)]),s("p",xn,i(v.tools.length)+" tools · "+i(v.resources.length+v.resourceTemplates.length)+" resources",1),a.expandedMcpNames.has(v.name)?(l(),o("div",On,[v.tools.length>0?(l(),o("div",Rn,[_[4]||(_[4]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",Bn,i(v.tools.map(c=>c.title||c.name).join(", ")),1)])):u("",!0),v.resources.length>0||v.resourceTemplates.length>0?(l(),o("div",Gn,[_[5]||(_[5]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",Kn,i([...v.resources.map(c=>c.title||c.name||c.uri),...v.resourceTemplates.map(c=>c.title||c.name||c.uriTemplate)].join(", ")),1)])):u("",!0)])):u("",!0)],8,En)]))),128))])):(l(),o("div",Pn," MCP status APIs unavailable in this Codex CLI. Update Codex CLI to inspect MCP servers. "))])):u("",!0)])]),_:1},8,["try-in-flight-key"])]))}}),Hn=ot(jn,[["__scopeId","data-v-6fa6298d"]]),qn={class:"directory-hub"},zn={class:"directory-header"},Vn={class:"directory-title"},Qn={class:"directory-subtitle"},Wn={class:"directory-header-actions"},Jn=["disabled"],Yn={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},Zn=["aria-selected","onClick"],Xn={class:"directory-modal"},er={class:"directory-modal-header"},tr={class:"directory-card-top"},sr=["src","alt"],ar={class:"directory-card-main"},lr={class:"directory-modal-title"},or={class:"directory-card-meta"},ir=["aria-label"],nr={class:"directory-modal-body"},rr={key:0,class:"directory-error"},cr={key:1,class:"directory-loading"},dr={key:0,class:"directory-detail-description"},ur={key:1,class:"directory-detail-block"},pr={class:"directory-chip-row"},yr={class:"directory-detail-grid"},mr={key:0,class:"directory-detail-block"},hr={class:"directory-detail-heading"},vr={key:0,class:"directory-auth-status is-warning"},gr=["onClick"],br={key:1,class:"directory-detail-block"},kr={class:"directory-detail-heading"},fr={class:"directory-mini-list"},$r={key:2,class:"directory-detail-block"},Cr=["disabled","onClick"],wr={key:2,class:"directory-screenshots"},Sr=["src"],_r={key:3,class:"directory-auth-panel"},Lr=["onClick"],Pr={class:"directory-modal-footer"},Ar=["disabled"],Ir=["disabled"],Mr={key:2,class:"directory-action",type:"button",disabled:""},Fr=["disabled"],Er=["disabled"],Tr={class:"directory-modal directory-modal--share"},Ur={class:"directory-modal-header"},Dr={class:"directory-card-main"},Nr={class:"directory-modal-title"},xr={class:"directory-card-meta"},Or=["aria-label"],Rr={class:"directory-modal-body"},Br={key:0,class:"directory-error"},Gr={key:1,class:"directory-loading"},Kr={key:0,class:"directory-empty"},jr={key:1,class:"directory-share-list"},Hr={class:"directory-share-info"},qr={class:"directory-share-name"},zr=["href"],Vr=["disabled","onClick"],Qr=["disabled","onClick"],Wr=["disabled"],Jr={class:"directory-modal"},Yr={class:"directory-modal-header"},Zr={class:"directory-card-top"},Xr=["src","alt"],ec={class:"directory-card-main"},tc={class:"directory-modal-title"},sc={class:"directory-card-meta"},ac=["aria-label"],lc={class:"directory-modal-body"},oc={key:0,class:"directory-error"},ic={key:1,class:"directory-loading"},nc={key:0,class:"directory-detail-description"},rc={class:"directory-detail-grid"},cc={class:"directory-detail-block"},dc={class:"directory-chip-row"},uc={class:"directory-chip"},pc={key:0,class:"directory-chip"},yc={key:1,class:"directory-chip"},mc={key:2,class:"directory-chip"},hc={class:"directory-detail-block"},vc={key:0,class:"directory-mini-list"},gc={key:1},bc={class:"directory-card-meta"},kc={key:1,class:"directory-detail-block"},fc={class:"directory-card-meta"},$c={class:"directory-modal-footer"},Cc=["disabled"],wc=["disabled"],Sc=50,Jt=100,Pc=be({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(a,{expose:N,emit:f}){const M=[[/^gmail$/i,3e4],[/^google calendar$/i,29500],[/^outlook( email| calendar)?$/i,29e3],[/^google drive$/i,28500],[/^google docs$/i,28e3],[/^google sheets$/i,27500],[/^dropbox$/i,27e3],[/^box$/i,26500],[/^slack$/i,26e3],[/^notion$/i,25500],[/^canva$/i,25e3],[/^figma$/i,24500],[/^github$/i,24e3],[/^trello$/i,23500],[/^asana$/i,23e3],[/^basecamp$/i,22500],[/^clickup$/i,22e3],[/^linear$/i,21500],[/^gitlab( issues)?$/i,21e3],[/^jira$/i,20500],[/^zapier$/i,2e4],[/^hubspot$/i,19500],[/^salesforce$/i,19e3],[/^netlify$/i,18500],[/^vercel$/i,18e3],[/^(spotify|youtube|netflix|hulu|disney|booking|expedia|uber|airbnb)$/i,17500]],_=[[/(email|mail|inbox|calendar|event|availability|contact|message|chat)/i,450],[/(drive|document|docs|sheet|slide|file|storage|pdf|note|page)/i,380],[/(image|design|presentation|diagram|video|audio|photo|media|music)/i,320],[/(travel|flight|hotel|restaurant|recipe|food|shopping|delivery|map|weather)/i,260],[/(learn|education|study|language|health|fitness|finance|budget)/i,220],[/(task|project|issue|repository|deploy|database|crm|sales|support)/i,120]],v=[[/(computer use|github|gitlab|linear|slack|notion|browser|web|filesystem|terminal)/i,120],[/(calendar|email|drive|docs|design|deploy|project|issue|search|database)/i,55]],c=[[/(github|gitlab|linear|slack|notion|filesystem|browser|computer|web|postgres|sqlite|database)/i,120],[/(search|drive|docs|calendar|terminal|shell|deploy|cloud|memory)/i,55]],p=a,I=f,x=ca(),H=da(),{t:r}=lt(),G=S(()=>[{id:"plugins",label:r("Plugins"),subtitle:r("Plugins make Codex work your way.")},{id:"apps",label:r("Apps"),subtitle:r("Connect Codex to external apps and services.")},{id:"composio",label:"Composio",subtitle:r("Browse Composio connectors, auth state, and ready-to-try integrations.")},{id:"skills",label:r("Skills"),subtitle:r("MCPs first, then installed skills and GitHub sync state.")}]),q=[{name:"Gmail",slug:"gmail",meta:"Inbox, drafts, attachments",description:"Find emails, summarize threads, draft replies, and pull attachment context into a chat.",chips:["Email","Search","Drafts"]},{name:"Google Calendar",slug:"google-calendar",meta:"Events and availability",description:"Check what is next, find open time, and turn follow-ups into calendar blocks.",chips:["Events","Availability","Reminders"]},{name:"Reddit",slug:"reddit",meta:"Posts, comments, communities",description:"Search communities, inspect posts, and prepare natural replies before posting.",chips:["Search","Comments","Posts"]},{name:"YouTube",slug:"youtube",meta:"Videos, channels, comments",description:"Look up channel details, inspect video metadata, and help manage comment workflows.",chips:["Videos","Channels","Comments"]},{name:"Google Drive",slug:"google-drive",meta:"Files, docs, folders",description:"Find files, read shared docs, and bring Drive context into a Codex thread.",chips:["Files","Docs","Search"]},{name:"X",slug:"x",meta:"Posts, replies, profiles",description:"Research public posts, draft replies, and keep social workflows reviewable.",chips:["Posts","Replies","Profiles"]}];function z(e){return e==="plugins"||e==="apps"||e==="composio"||e==="skills"}function te(){return z(x.query.tab)?x.query.tab:"skills"}const F=m(te()),$=m(new Set),w=m(!1),k=m([]),V=m([]),A=m(null),D=m([]),K=m(null),Q=m(0),X=m([]),me=m("popular"),se=m("popular"),ke=m("popular"),ae=m(""),le=m(""),Z=m(""),W=m(!1),he=m(!1),fe=m(!1),Me=m(!1),Re=m(!1),ce=m(!1),Fe=m(!0),Be=m(""),Ge=m(""),Ke=m(""),je=m(""),L=m(null),U=m(null),$e=m(!1),He=m(!1),Ee=m(""),P=m(null),de=m(!1),qe=m(!1),Ce=m(""),Te=m(!1),Ue=m(!1),J=m(!1),De=m(""),ve=m(""),ue=m([]),we=m(""),O=m(new Set),Se=m(null),g=m(""),h=m(""),b=m(!1),R=m([]),oe=m(!1),ie=m(!1),ee=m(!1),pe=m(""),_e=m("");let ze=null,Ve=null;Yt(()=>{ze&&clearTimeout(ze),Ve&&clearTimeout(Ve)});let it=!1;const Xt=S(()=>G.value.find(e=>e.id===F.value)??G.value[0]),ht=S(()=>!w.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>$.value.has(e))),Je=S(()=>!w.value||$.value.has("app/list")),nt=S(()=>!w.value||$.value.has("mcpServerStatus/list")),vt=S(()=>$.value.has("config/mcpServer/reload")),gt=S(()=>$.value.has("mcpServer/oauth/login")),es=S(()=>!w.value||["marketplace/add","marketplace/remove","marketplace/upgrade"].every(e=>$.value.has(e))),ts=S(()=>!w.value||["plugin/share/save","plugin/share/list","plugin/share/delete"].every(e=>$.value.has(e))),Le=S(()=>(p.tryInFlightKey??"").length>0),bt=S(()=>{var e,t,d;return((e=U.value)==null?void 0:e.description)||((t=U.value)==null?void 0:t.summary.longDescription)||((d=U.value)==null?void 0:d.summary.description)||""}),kt=S(()=>{var t;const e=(t=U.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(Xe)].filter(Boolean):[]}),rt=S(()=>{var d;const e=((d=U.value)==null?void 0:d.apps)??[];if(e.length===0)return!1;const t=new Set;for(const C of V.value)t.add(C.id.trim().toLowerCase()),t.add(wt(C.name));return e.some(C=>{const j=C.id.trim().toLowerCase(),ge=wt(C.name),Ae=j.length>0&&t.has(j),tt=ge.length>0&&t.has(ge);return!Ae&&!tt})}),ss=S(()=>{var e,t;return((e=L.value)==null?void 0:e.installPolicy)==="NOT_AVAILABLE"||(((t=U.value)==null?void 0:t.apps.some(d=>Ct(d)))??!1)}),as=S(()=>bs(ws(fs(k.value,ae.value),me.value),me.value,ae.value)),ls=S(()=>{const e=new Map;for(const t of k.value){if(!t.marketplaceName)continue;const d=t.marketplaceName;e.has(d)||e.set(d,{name:t.marketplaceName,displayName:t.marketplaceDisplayName||t.marketplaceName,path:t.marketplacePath})}return[...e.values()].sort((t,d)=>t.displayName.localeCompare(d.displayName))}),os=S(()=>ks(Ss($s(V.value,le.value),se.value),se.value,le.value)),is=S(()=>ua(Cs(D.value,Z.value),ke.value,Z.value)),ns=S(()=>{const e=Qe(Z.value);return e?q.filter(t=>Ye([t.name,t.slug,t.meta,t.description,...t.chips],e)):q}),rs=S(()=>_s(X.value)),ft=S(()=>K.value!==null),cs=S(()=>new Map(X.value.map(e=>[e.name,e]))),ds=S(()=>{const e=A.value;return e&&[e.email||e.defaultOrgName,e.defaultOrgId?`org ${e.defaultOrgId}`:"",e.baseUrl||""].filter(Boolean).join(" · ")||r("Composio CLI shares the login and connections from this machine.")});function Qe(e){return e.trim().toLowerCase()}function us(e){return Qe(e).replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").replace(/[-_]+/gu," ").replace(/\s+plugin$/iu,"").replace(/\s+/gu," ").trim()}function $t(...e){const t=new Set;for(const d of e){const C=us(d);C&&(t.add(C),t.add(C.replace(/\s+/gu,"")))}return Array.from(t)}function ps(e){return!e.isAccessible&&e.installUrl.trim().length===0}function ys(e){const t=e.id.trim();if(t){const C=V.value.find(j=>j.id===t);if(C)return C}const d=$t(e.name);return V.value.find(C=>$t(C.name).some(j=>d.includes(j)))??null}function Ct(e){const t=ys(e);return t?ps(t):e.needsAuth&&e.installUrl.trim().length===0}function Ye(e,t){const d=Qe(t);return d?e.some(C=>C==null?void 0:C.toLowerCase().includes(d)):!0}function Ze(e,t){return t.reduce((d,[C,j])=>d+(C.test(e)?j:0),0)}function ct(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function wt(e){return ct(e).toLowerCase()}function ms(e){return e==="DEFAULT_OAI_CATALOG"?r("OpenAI catalog"):e==="ECOSYSTEM_DIRECTORY"?r("Ecosystem directory"):e?e.replace(/_/gu," ").toLowerCase().replace(/\b\w/gu,t=>t.toUpperCase()):""}function hs(e){return e.developer||ms(e.distributionChannel)||r("App")}function dt(e){var t;return((t=cs.value.get(e))==null?void 0:t.authStatus)??"unknown"}function St(e){const t=dt(e);return r(t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown")}function vs(e){const t=dt(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function gs(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function _t(e){return gt.value&&dt(e)==="notLoggedIn"}function bs(e,t,d){return t==="popular"&&Qe(d).length===0?e.slice(0,Jt):e}function ks(e,t,d){if(t!=="popular"||Qe(d).length>0)return e;const C=new Set,j=[];for(const ge of e){const Ae=ct(ge.name).toLowerCase();if(!C.has(Ae)&&(C.add(Ae),j.push(ge),j.length>=Jt))break}return j}function fs(e,t){return e.filter(d=>Ye([d.displayName,d.name,d.description,d.developerName,d.category,d.marketplaceDisplayName,...d.capabilities],t))}function $s(e,t){return e.filter(d=>Ye([d.name,d.description,d.developer,d.category,d.distributionChannel,...d.pluginDisplayNames],t))}function Cs(e,t){return e.filter(d=>Ye([d.name,d.slug,d.description,...d.authModes,...d.connectionStatuses],t))}function Lt(e){return(e.installed?500:0)+(e.enabled?40:0)+(e.developerName.toLowerCase().includes("openai")?140:0)+(e.sourceType==="local"?80:0)+e.capabilities.length*12+Ze(`${e.displayName} ${e.name} ${e.description} ${e.category}`,v)}function Pt(e){const t=ct(e.name);return(e.isAccessible?1e4:0)+Ze(t,M)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+Ze(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,_)-e.catalogRank*.001}function At(e){return(e.authStatus==="oAuth"?180:0)+(e.authStatus==="bearerToken"?140:0)+Math.min(e.tools.length,50)*6+Math.min(e.resources.length+e.resourceTemplates.length,30)*3+Ze(e.name,c)}function ws(e,t){return t==="name"?[...e].sort((d,C)=>d.displayName.localeCompare(C.displayName)):t==="date"?[...e]:[...e].sort((d,C)=>Lt(C)-Lt(d)||d.displayName.localeCompare(C.displayName))}function Ss(e,t){return t==="name"?[...e].sort((d,C)=>d.name.localeCompare(C.name)):t==="date"?[...e].sort((d,C)=>d.catalogRank-C.catalogRank):[...e].sort((d,C)=>Pt(C)-Pt(d)||d.name.localeCompare(C.name))}function _s(e,t){return[...e].sort((d,C)=>At(C)-At(d)||d.name.localeCompare(C.name))}function E(e,t="success"){Se.value={text:e,type:t},ze&&clearTimeout(ze),ze=setTimeout(()=>{Se.value=null},3e3)}function Xe(e){return e?e.startsWith("connectors://")?`/codex-api/connector-logo?src=${encodeURIComponent(e)}`:/^https?:\/\//i.test(e)||e.startsWith("data:")?e:e.startsWith("/")?`/codex-local-image?path=${encodeURIComponent(e)}`:"":""}function ut(e){return e?e.logoUrl||Xe(e.logoPath)||e.composerIconUrl||Xe(e.composerIconPath):""}function Ls(e){return Xe(e.logoUrlDark||e.logoUrl)}function It(e){return e.activeCount>0?`${e.activeCount} ${r("connected")} ${e.activeCount===1?r("account"):r("accounts")}`:e.isNoAuth?r("No auth required"):e.connectionStatuses.length>0?e.connectionStatuses.join(", "):e.authModes.join(", ")||r("Connection required")}function Ps(e){return e.isNoAuth||e.activeCount>0}function pt(e){return e.isNoAuth?"":e.activeCount>0?r("Manage"):e.totalConnections>0?r("Reconnect"):r("Connect")}function As(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?r("Active"):t==="EXPIRED"?r("Expired"):t==="FAILED"?r("Failed"):t==="INITIATED"?r("Pending"):t||r("Unknown")}function Is(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function Ms(e){return`app:${e.id}:`}function Fs(e){Le.value||I("try-item",{kind:"app",name:e.id,displayName:e.name})}function Es(e){return`plugin:${e.name}:`}function Mt(e){return`composio:${e}:`}function Ts(e){Le.value||I("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function Ft(e){return Ps(e)}function Us(e,t=[]){const d=t.find(j=>j.status==="ACTIVE"&&!j.isDisabled),C=d!=null&&d.wordId?` If there are multiple accounts, prefer \`${d.wordId}\`.`:"";return`Use the Composio CLI skill with the ${e.name} connector (${e.slug}). Start by listing what it can do here, mention the current connection status, and suggest one safe command I can run now.${C}`}function Et(e,t=[]){Le.value||I("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:Us(e,t),attachedSkills:[{name:"composio-cli"}]})}function ne(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function Ds(e){const t=e.find(d=>d.needsAuth&&d.installUrl.trim().length>0);return t?(ne(t.installUrl),!0):!1}async function Ns(){try{$.value=new Set(await pa())}catch{$.value=new Set}finally{w.value=!0}}async function ye(){var e;if(ht.value){W.value=!0,Be.value="";try{const t=(e=p.cwd)==null?void 0:e.trim(),[d]=await Promise.all([ya(t?[t]:void 0),Je.value?Ne():Promise.resolve()]);k.value=d}catch(t){Be.value=t instanceof Error?t.message:"Failed to load plugins"}finally{W.value=!1}}}async function xs(){const e=g.value.trim();if(e){b.value=!0,h.value="add";try{await ma(e),g.value="",E("Marketplace added"),await ye()}catch(t){E(t instanceof Error?t.message:"Failed to add marketplace","error")}finally{b.value=!1,h.value=""}}}async function Os(e){b.value=!0,h.value=`remove:${e}`;try{await ha(e),E("Marketplace removed"),await ye()}catch(t){E(t instanceof Error?t.message:"Failed to remove marketplace","error")}finally{b.value=!1,h.value=""}}async function Rs(){b.value=!0,h.value="upgrade";try{const e=await va();e.errors.length>0?E(e.errors.join("; "),"error"):E(`Upgraded ${e.upgradedRoots.length||e.selectedMarketplaces.length||"all"} marketplace${e.upgradedRoots.length+e.selectedMarketplaces.length===1?"":"s"}`),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to upgrade marketplaces","error")}finally{b.value=!1,h.value=""}}async function Ne(){var e;if(Je.value){he.value=!0,Ge.value="";try{V.value=await ga(((e=p.threadId)==null?void 0:e.trim())||void 0)}catch(t){Ge.value=t instanceof Error?t.message:"Failed to load apps"}finally{he.value=!1}}}async function Pe(e=!1){if(fe.value){it=!0;return}fe.value=!0,Ke.value="";try{const t=await ba();if(A.value=t,!t.available||!t.authenticated){D.value=[],K.value=null,Q.value=0;return}const d=e?K.value:null,C=await ka(Z.value,d,Sc);D.value=e?[...D.value,...C.data]:C.data,K.value=C.nextCursor,Q.value=C.total}catch(t){Ke.value=t instanceof Error?t.message:"Failed to load Composio connectors",D.value=[],K.value=null,Q.value=0}finally{fe.value=!1,it&&(it=!1,Pe())}}async function Bs(){!ft.value||fe.value||await Pe(!0)}async function et(){if(nt.value){Me.value=!0,je.value="";try{X.value=await Qt()}catch(e){je.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{Me.value=!1}}}async function Tt(){var e;if(!(!nt.value||!((e=U.value)!=null&&e.mcpServers.length)))try{X.value=await Qt()}catch{}}function Ut(e=!1){F.value==="plugins"&&ye(),F.value==="apps"&&Ne(),F.value==="composio"&&Pe(),F.value==="skills"&&(e&&vt.value?jt():et())}function Gs(e){if(e==="app/list/updated"){Ne();return}(e==="mcpServer/startupStatus/updated"||e==="mcpServer/oauthLogin/completed")&&et()}N({refreshFromNotification:Gs});async function Ks(){ce.value=!0;try{F.value==="plugins"?await ye():F.value==="apps"?await Ne():F.value==="composio"?await Pe():F.value==="skills"&&vt.value?await jt():F.value==="skills"&&await et()}finally{ce.value=!1}}async function Dt(e){L.value=e,U.value=null,Ee.value="",ue.value=[],$e.value=!0,He.value=!0;try{U.value=await fa(e),L.value=U.value.summary,Je.value&&V.value.length===0&&await Ne(),await Tt()}catch(t){Ee.value=t instanceof Error?t.message:"Failed to load plugin"}finally{He.value=!1}}async function Nt(e){if(!gt.value)return!1;we.value=e;try{const t=await $a(e);return t.authorizationUrl?(ne(t.authorizationUrl),!0):(E(r("No login URL returned for {name}",{name:e}),"error"),!1)}catch(t){return E(t instanceof Error?t.message:r("Failed to start login for {name}",{name:e}),"error"),!1}finally{we.value=""}}async function js(e){await Tt();const t=e.mcpServers.find(d=>_t(d));t&&await Nt(t)}function yt(){$e.value=!1}function xt(){const e=L.value;return e?e.marketplacePath?`${e.marketplacePath.replace(/[\\/]+$/,"")}/${e.name}`:e.sourceUrl||"":""}async function Ot(){_e.value="",oe.value=!0,ie.value=!0;try{R.value=await Ca()}catch(e){_e.value=e instanceof Error?e.message:"Failed to load plugin shares"}finally{ie.value=!1}}async function Hs(){const e=xt();if(e){ee.value=!0,pe.value="save";try{const t=await wa(e);E(t.shareUrl?"Plugin shared":"Plugin shared (no URL returned)"),await Ot()}catch(t){_e.value=t instanceof Error?t.message:"Failed to share plugin"}finally{ee.value=!1,pe.value=""}}}async function qs(e){ee.value=!0,pe.value=`delete:${e}`;try{await Sa(e),R.value=R.value.filter(t=>t.remotePluginId!==e),E("Share removed")}catch(t){_e.value=t instanceof Error?t.message:"Failed to remove share"}finally{ee.value=!1,pe.value=""}}async function zs(e){ee.value=!0,pe.value=`checkout:${e}`;try{await _a(e),E("Plugin checked out")}catch(t){_e.value=t instanceof Error?t.message:"Failed to checkout plugin"}finally{ee.value=!1,pe.value=""}}function Rt(){oe.value=!1}async function Bt(e){de.value=!0,qe.value=!0,Ce.value="",P.value=null;try{P.value=await La(e)}catch(t){Ce.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{qe.value=!1}}function Gt(){de.value=!1}async function Vs(e){var t;ve.value=e.slug;try{const d=await Ua(e.slug);if(!d.redirectUrl){E(r("No login URL returned for {name}",{name:e.name}),"error");return}ne(d.redirectUrl),E(r("Opened {name} authorization",{name:e.name})),await Pe(),de.value&&((t=P.value)==null?void 0:t.connector.slug)===e.slug&&await Bt(e.slug)}catch(d){E(d instanceof Error?d.message:r("Failed to connect {name}",{name:e.name}),"error")}finally{ve.value=""}}async function Kt(e){var t;if(e.activeCount>0&&((t=A.value)!=null&&t.webUrl)){ne(A.value.webUrl);return}await Vs(e)}async function Qs(){Ue.value=!0;const e=window.open("about:blank","_blank");e&&(e.opener=null);try{const t=await Pa();t.loginUrl&&e?e.location.href=t.loginUrl:t.loginUrl?ne(t.loginUrl):e==null||e.close(),E("Composio CLI login started")}catch(t){e==null||e.close(),E(t instanceof Error?t.message:"Failed to start Composio login","error")}finally{Ue.value=!1}}async function Ws(){Te.value=!0;try{await Aa(),E("Composio CLI installed"),await Pe()}catch(e){E(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{Te.value=!1}}async function Js(){if(L.value&&!rt.value){J.value=!0;try{const e=await Ia(L.value);ue.value=e.appsNeedingAuth,E(`${L.value.displayName} ${r("plugin installed")}`);const t=Ds(e.appsNeedingAuth);await ye();const d=k.value.find(C=>{var j;return C.id===((j=L.value)==null?void 0:j.id)});d&&(await Dt(d),!t&&U.value&&await js(U.value))}catch(e){E(e instanceof Error?e.message:"Failed to install plugin","error")}finally{J.value=!1}}}async function Ys(){if(L.value){J.value=!0;try{const e=L.value.displayName;await Ma(L.value.id),E(`${e} ${r("plugin uninstalled")}`),yt(),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{J.value=!1}}}async function Zs(){if(L.value){J.value=!0;try{const e=!L.value.enabled;await Fa(L.value.id,e),L.value={...L.value,enabled:e},U.value&&(U.value={...U.value,summary:{...U.value.summary,enabled:e}}),E(`${L.value.displayName} ${r("plugin")} ${r(e?"enabled":"disabled")}`),await ye()}catch(e){E(e instanceof Error?e.message:"Failed to update plugin","error")}finally{J.value=!1}}}async function Xs(e){De.value=e.id;try{const t=!e.isEnabled;await Ea(e.id,t),V.value=V.value.map(d=>d.id===e.id?{...d,isEnabled:t}:d),E(`${e.name} ${r("app")} ${r(t?"enabled":"disabled")}`)}catch(t){E(t instanceof Error?t.message:"Failed to update app","error")}finally{De.value=""}}async function jt(){Re.value=!0;try{await Ta(),await et(),E("MCP servers reloaded")}catch(e){E(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{Re.value=!1}}function ea(e){const t=new Set(O.value);t.has(e)?t.delete(e):t.add(e),O.value=t}return Ie(F,e=>{x.name==="skills"&&x.query.tab!==e&&H.replace({name:"skills",query:{...x.query,tab:e}}),Ut()}),Ie(()=>x.query.tab,()=>{if(x.name!=="skills")return;const e=te();F.value!==e&&(F.value=e)}),Ie(Z,()=>{F.value==="composio"&&(D.value=[],K.value=null,Q.value=0,Ve&&clearTimeout(Ve),Ve=setTimeout(()=>{Pe()},250))}),Ie(()=>p.cwd,()=>{F.value==="plugins"&&ye()}),Ie(()=>p.threadId,()=>{(F.value==="apps"||F.value==="plugins")&&Ne()}),Zt(async()=>{await Ns(),Ut()}),(e,t)=>{var d,C,j,ge,Ae,tt,Ht,qt;return l(),o("div",qn,[s("div",zn,[s("div",null,[s("h2",Vn,i(n(r)("Skills"))+" & "+i(n(r)("Apps")),1),s("p",Qn,i(Xt.value.subtitle),1)]),s("div",Wn,[s("button",{class:"directory-refresh",type:"button",disabled:ce.value,onClick:Ks},i(ce.value?"Refreshing...":"Refresh"),9,Jn)])]),s("div",Yn,[(l(!0),o(T,null,B(G.value,y=>(l(),o("button",{key:y.id,class:Y(["directory-tab",{"is-active":F.value===y.id}]),type:"button",role:"tab","aria-selected":F.value===y.id,onClick:We=>F.value=y.id},i(y.label),11,Zn))),128))]),Se.value?(l(),o("div",{key:0,class:Y(["directory-toast",{"is-error":Se.value.type==="error"}])},i(Se.value.text),3)):u("",!0),F.value==="plugins"?(l(),re(Qo,{key:1,plugins:as.value,"search-query":ae.value,"sort-mode":me.value,"supports-plugins":ht.value,"supports-marketplace":es.value,error:Be.value,"is-loading":W.value,marketplaces:ls.value,"marketplace-source-url":g.value,"marketplace-action-name":h.value,"is-marketplace-action-in-flight":b.value,"plugin-icon-src":ut,"open-plugin-detail":Dt,"add-marketplace":xs,"remove-marketplace":Os,"upgrade-all-marketplaces":Rs,"disabled-label":n(r)("Disabled"),"installed-label":n(r)("Installed"),"plugin-label":n(r)("Plugin"),"upgrade-all-label":n(r)("Upgrade all"),"upgrading-label":n(r)("Upgrading..."),"removing-label":n(r)("Removing..."),"remove-label":n(r)("Remove"),"adding-label":n(r)("Adding..."),"add-label":n(r)("Add"),"onUpdate:searchQuery":t[0]||(t[0]=y=>ae.value=y),"onUpdate:sortMode":t[1]||(t[1]=y=>me.value=y),"onUpdate:marketplaceSourceUrl":t[2]||(t[2]=y=>g.value=y)},null,8,["plugins","search-query","sort-mode","supports-plugins","supports-marketplace","error","is-loading","marketplaces","marketplace-source-url","marketplace-action-name","is-marketplace-action-in-flight","disabled-label","installed-label","plugin-label","upgrade-all-label","upgrading-label","removing-label","remove-label","adding-label","add-label"])):F.value==="apps"?(l(),re(nl,{key:2,apps:os.value,"search-query":le.value,"sort-mode":se.value,"supports-apps":Je.value,error:Ge.value,"is-loading":he.value,"action-id":De.value,"try-in-flight-key":p.tryInFlightKey,"is-try-action-in-flight":Le.value,"app-logo-src":Ls,"app-meta-label":hs,"app-try-key":Ms,"toggle-app":Xs,"open-external-url":ne,"try-app":Fs,"disabled-label":n(r)("Disabled"),"connected-label":n(r)("Connected"),"enable-label":n(r)("Enable"),"disable-label":n(r)("Disable"),"manage-label":n(r)("Manage"),"login-label":n(r)("Login"),"try-label":n(r)("Try it!"),"starting-label":n(r)("Starting..."),"onUpdate:searchQuery":t[3]||(t[3]=y=>le.value=y),"onUpdate:sortMode":t[4]||(t[4]=y=>se.value=y)},null,8,["apps","search-query","sort-mode","supports-apps","error","is-loading","action-id","try-in-flight-key","is-try-action-in-flight","disabled-label","connected-label","enable-label","disable-label","manage-label","login-label","try-label","starting-label"])):F.value==="composio"?(l(),re(mo,{key:3,"composio-status":A.value,"search-query":Z.value,"sort-mode":ke.value,error:Ke.value,"is-loading-composio":fe.value,"is-installing-composio":Te.value,"is-starting-composio-login":Ue.value,"visible-composio-connectors":is.value,"visible-composio-preview-connectors":ns.value,"workspace-summary":ds.value,"connector-count":D.value.length,total:Q.value,"has-more-composio-connectors":ft.value,"action-slug":ve.value,"is-try-action-in-flight":Le.value,"try-in-flight-key":p.tryInFlightKey,"composio-meta-label":It,"composio-primary-action-label":pt,"can-try-composio":Ft,"composio-try-key":Mt,"open-composio-detail":Bt,"run-composio-primary-action":Kt,"try-composio":Et,"install-composio-cli":Ws,"start-composio-cli-login":Qs,"load-more-composio":Bs,"open-external-url":ne,"workspace-label":n(r)("Composio workspace"),"connected-label":n(r)("Connected"),"authenticated-label":n(r)("Authenticated"),"no-auth-label":n(r)("No auth"),"preview-label":n(r)("Preview"),"open-dashboard-label":n(r)("Open dashboard"),"details-label":n(r)("Details"),"install-label":n(r)("Install Composio"),"installing-label":n(r)("Installing..."),"login-label":n(r)("Login to Composio"),"opening-label":n(r)("Opening..."),"starting-label":n(r)("Starting..."),"try-label":n(r)("Try it!"),"load-more-label":n(r)("Load more"),"loading-label":n(r)("Loading..."),"onUpdate:searchQuery":t[5]||(t[5]=y=>Z.value=y),"onUpdate:sortMode":t[6]||(t[6]=y=>ke.value=y)},null,8,["composio-status","search-query","sort-mode","error","is-loading-composio","is-installing-composio","is-starting-composio-login","visible-composio-connectors","visible-composio-preview-connectors","workspace-summary","connector-count","total","has-more-composio-connectors","action-slug","is-try-action-in-flight","try-in-flight-key","workspace-label","connected-label","authenticated-label","no-auth-label","preview-label","open-dashboard-label","details-label","install-label","installing-label","login-label","opening-label","starting-label","try-label","load-more-label","loading-label"])):F.value==="skills"?(l(),re(Hn,{key:4,"try-in-flight-key":p.tryInFlightKey,"supports-mcps":nt.value,"mcp-error":je.value,"is-loading-mcps":Me.value,"visible-mcp-servers":rs.value,"is-mcp-section-open":Fe.value,"expanded-mcp-names":O.value,"format-mcp-auth-status":St,"mcp-card-badge-class":gs,"toggle-mcp-section-open":()=>{Fe.value=!Fe.value},"toggle-mcp-expanded":ea,onSkillsChanged:t[7]||(t[7]=y=>I("skills-changed")),onTryItem:t[8]||(t[8]=y=>I("try-item",y))},null,8,["try-in-flight-key","supports-mcps","mcp-error","is-loading-mcps","visible-mcp-servers","is-mcp-section-open","expanded-mcp-names","toggle-mcp-section-open"])):u("",!0),(l(),re(st,{to:"body"},[$e.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(yt,["self"])},[s("article",Xn,[s("div",er,[s("div",tr,[L.value&&ut(L.value)?(l(),o("img",{key:0,class:"directory-card-icon",src:ut(L.value),alt:L.value.displayName,loading:"lazy"},null,8,sr)):u("",!0),s("div",ar,[s("h3",lr,i(((d=L.value)==null?void 0:d.displayName)||n(r)("Plugin")),1),s("span",or,i(((C=L.value)==null?void 0:C.developerName)||((j=L.value)==null?void 0:j.marketplaceDisplayName)||((ge=L.value)==null?void 0:ge.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin detail"),onClick:yt},i(n(r)("Close")),9,ir)]),s("div",nr,[Ee.value?(l(),o("div",rr,i(Ee.value),1)):He.value?(l(),o("div",cr,"Loading plugin...")):U.value?(l(),o(T,{key:2},[bt.value?(l(),o("p",dr,i(bt.value),1)):u("",!0),U.value.summary.capabilities.length>0?(l(),o("div",ur,[t[13]||(t[13]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",pr,[(l(!0),o(T,null,B(U.value.summary.capabilities,y=>(l(),o("span",{key:y,class:"directory-chip"},i(y),1))),128))])])):u("",!0),s("div",yr,[U.value.apps.length>0?(l(),o("div",mr,[s("h4",hr,i(n(r)("Apps")),1),(l(!0),o(T,null,B(U.value.apps,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,i(y.name),1),Ct(y)?(l(),o("span",vr,"GPT Plus account required")):y.installUrl?(l(),o("button",{key:1,type:"button",onClick:We=>ne(y.installUrl)},i(y.needsAuth?"Login":"Manage"),9,gr)):u("",!0)]))),128))])):u("",!0),U.value.skills.length>0?(l(),o("div",br,[s("h4",kr,i(n(r)("Skills")),1),s("p",fr,i(U.value.skills.map(y=>y.displayName||y.name).join(", ")),1)])):u("",!0),U.value.mcpServers.length>0?(l(),o("div",$r,[t[14]||(t[14]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(l(!0),o(T,null,B(U.value.mcpServers,y=>(l(),o("div",{key:y,class:"directory-include-row"},[s("span",null,[at(i(y)+" ",1),s("span",{class:Y(["directory-auth-status",vs(y)])},i(St(y)),3)]),_t(y)?(l(),o("button",{key:0,type:"button",disabled:we.value===y,onClick:We=>Nt(y)},i(we.value===y?"Opening...":"Authenticate"),9,Cr)):u("",!0)]))),128))])):u("",!0)]),kt.value.length>0?(l(),o("div",wr,[(l(!0),o(T,null,B(kt.value,y=>(l(),o("img",{key:y,src:y,alt:"",loading:"lazy"},null,8,Sr))),128))])):u("",!0),ue.value.length>0?(l(),o("div",_r,[s("strong",null,i(n(r)("Apps needing auth")),1),(l(!0),o(T,null,B(ue.value,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,i(y.name),1),y.installUrl?(l(),o("button",{key:0,type:"button",onClick:We=>ne(y.installUrl)},i(n(r)("Login")),9,Lr)):u("",!0)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",Pr,[L.value&&L.value.installed?(l(),o("button",{key:0,class:"directory-action danger",type:"button",disabled:J.value,onClick:Ys},i(J.value?"Uninstalling...":"Uninstall"),9,Ar)):L.value&&!ss.value?(l(),o("button",{key:1,class:"directory-action primary",type:"button",disabled:J.value||L.value.installPolicy==="NOT_AVAILABLE"||rt.value,onClick:Js},i(rt.value?"ChatGPT Plus":J.value?"Installing...":"Install"),9,Ir)):L.value?(l(),o("button",Mr," GPT Plus account required ")):u("",!0),L.value&&L.value.installed?(l(),o("button",{key:3,class:"directory-action",type:"button",disabled:J.value,onClick:Zs},i(L.value.enabled?"Disable":"Enable"),9,Fr)):u("",!0),L.value&&L.value.installed&&L.value.enabled?(l(),o("button",{key:4,class:"directory-action primary",type:"button",disabled:J.value||Le.value,onClick:t[9]||(t[9]=y=>Ts(L.value))},i(p.tryInFlightKey===Es(L.value)?"Starting...":"Try it!"),9,Er)):u("",!0),ts.value&&L.value&&L.value.installed?(l(),o("button",{key:5,class:"directory-action",type:"button",onClick:Ot},i(n(r)("Share")),1)):u("",!0)])])])):u("",!0)])),(l(),re(st,{to:"body"},[oe.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(Rt,["self"])},[s("article",Tr,[s("div",Ur,[s("div",Dr,[s("h3",Nr,i(n(r)("Plugin shares")),1),s("span",xr,i(((Ae=L.value)==null?void 0:Ae.displayName)||n(r)("Plugin")),1)]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin shares"),onClick:Rt},i(n(r)("Close")),9,Or)]),s("div",Rr,[_e.value?(l(),o("div",Br,i(_e.value),1)):ie.value?(l(),o("div",Gr,"Loading shares...")):(l(),o(T,{key:2},[R.value.length===0?(l(),o("p",Kr,"No shares yet. Share this plugin to make it available on other devices.")):(l(),o("div",jr,[(l(!0),o(T,null,B(R.value,y=>(l(),o("div",{key:y.remotePluginId,class:"directory-share-row"},[s("div",Hr,[s("span",qr,i(y.pluginName),1),y.shareUrl?(l(),o("a",{key:0,class:"directory-share-link",href:y.shareUrl,target:"_blank",rel:"noreferrer"},i(y.shareUrl),9,zr)):u("",!0)]),s("button",{class:"directory-share-checkout",type:"button",disabled:ee.value,onClick:We=>zs(y.remotePluginId)},i(pe.value===`checkout:${y.remotePluginId}`?n(r)("Checking out..."):n(r)("Checkout")),9,Vr),s("button",{class:"directory-share-delete",type:"button",disabled:ee.value,onClick:We=>qs(y.remotePluginId)},i(pe.value===`delete:${y.remotePluginId}`?n(r)("Removing..."):n(r)("Remove")),9,Qr)]))),128))])),s("button",{class:"directory-action primary",type:"button",disabled:ee.value||!xt(),onClick:Hs},i(pe.value==="save"?n(r)("Sharing..."):n(r)("Share this plugin")),9,Wr)],64))])])])):u("",!0)])),(l(),re(st,{to:"body"},[de.value?(l(),o("div",{key:0,class:"directory-modal-overlay",onClick:xe(Gt,["self"])},[s("article",Jr,[s("div",Yr,[s("div",Zr,[(tt=P.value)!=null&&tt.connector.logoUrl?(l(),o("img",{key:0,class:"directory-card-icon",src:P.value.connector.logoUrl,alt:P.value.connector.name,loading:"lazy"},null,8,Xr)):u("",!0),s("div",ec,[s("h3",tc,i(((Ht=P.value)==null?void 0:Ht.connector.name)||"Composio"),1),s("span",sc,i(P.value?It(P.value.connector):n(r)("Connector")),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close Composio detail"),onClick:Gt},i(n(r)("Close")),9,ac)]),s("div",lc,[Ce.value?(l(),o("div",oc,i(Ce.value),1)):qe.value?(l(),o("div",ic,"Loading connector...")):P.value?(l(),o(T,{key:2},[P.value.connector.description?(l(),o("p",nc,i(P.value.connector.description),1)):u("",!0),s("div",rc,[s("div",cc,[t[15]||(t[15]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",dc,[s("span",uc,i(P.value.connector.toolsCount)+" tools",1),P.value.connector.triggersCount>0?(l(),o("span",pc,i(P.value.connector.triggersCount)+" triggers",1)):u("",!0),P.value.connector.latestVersion?(l(),o("span",yc,"v"+i(P.value.connector.latestVersion),1)):u("",!0),P.value.connector.authModes.length>0?(l(),o("span",mc,i(P.value.connector.authModes.join(", ")),1)):u("",!0)])]),s("div",hc,[t[16]||(t[16]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),P.value.connections.length===0?(l(),o("div",vc," No linked accounts yet. ")):(l(),o("div",gc,[(l(!0),o(T,null,B(P.value.connections,y=>(l(),o("div",{key:y.id,class:"directory-include-row"},[s("span",null,[at(i(y.alias||y.wordId||y.id)+" ",1),s("span",{class:Y(["directory-auth-status",Is(y.status)])},i(As(y.status)),3)]),s("span",bc,i(y.authScheme||"Auth"),1)]))),128))]))])]),P.value.tools.length>0?(l(),o("div",kc,[t[17]||(t[17]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(l(!0),o(T,null,B(P.value.tools.slice(0,8),y=>(l(),o("div",{key:y.slug,class:"directory-include-row"},[s("span",null,i(y.name||y.slug),1),s("span",fc,i(y.slug),1)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",$c,[P.value?(l(),o("button",{key:0,class:"directory-action-link",type:"button",onClick:t[10]||(t[10]=y=>ne(P.value.dashboardUrl))}," Open dashboard ")):u("",!0),P.value&&pt(P.value.connector)?(l(),o("button",{key:1,class:"directory-action",type:"button",disabled:ve.value===P.value.connector.slug,onClick:t[11]||(t[11]=y=>Kt(P.value.connector))},i(ve.value===((qt=P.value)==null?void 0:qt.connector.slug)?"Opening...":pt(P.value.connector)),9,Cc)):u("",!0),P.value&&Ft(P.value.connector)?(l(),o("button",{key:2,class:"directory-action primary",type:"button",disabled:Le.value,onClick:t[12]||(t[12]=y=>Et(P.value.connector,P.value.connections))},i(p.tryInFlightKey===Mt(P.value.connector.slug)?"Starting...":"Try it!"),9,wc)):u("",!0)])])])):u("",!0)]))])}}});export{Pc as default};
@@ -1 +1 @@
1
- import{e as B,f as u,i as d,j as s,F as A,l as S,w as k,n as j,u as r,t as c,k as D,v as T,r as _,_ as V}from"./index-rc4ZsEIH.js";const E={key:0,class:"queued-messages"},L={class:"queued-messages-inner"},z=["onDragstart","onDragover","onDragleave","onDrop"],F=["aria-label","title"],N={class:"queued-row-text"},Q={key:0,class:"queued-row-badge"},U={class:"queued-row-actions"},H=["title","onClick"],I=["title","onClick"],O=["aria-label","title","onClick"],P=B({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete","reorder"],setup(h,{emit:q}){const C=q,{t:o}=T(),i=_(""),l=_("");function b(t,a){var e;i.value=a,l.value="",(e=t.dataTransfer)==null||e.setData("text/plain",a),t.dataTransfer&&(t.dataTransfer.effectAllowed="move")}function $(t){!i.value||i.value===t||(l.value=t)}function M(t){l.value===t&&(l.value="")}function x(t){const a=i.value;p(),!(!a||a===t)&&C("reorder",{draggedId:a,targetId:t})}function p(){i.value="",l.value=""}function y(t){var f,w,m;const a=t.text.trim();if(a)return a;const e=[],n=((f=t.imageUrls)==null?void 0:f.length)??0,g=((w=t.fileAttachments)==null?void 0:w.length)??0,v=((m=t.skills)==null?void 0:m.length)??0;return n>0&&e.push(`${n} ${o(n===1?"image":"images")}`),g>0&&e.push(`${g} ${o(g===1?"file":"files")}`),v>0&&e.push(`${v} ${o(v===1?"skill":"skills")}`),e.join(", ")||o("(empty queued message)")}return(t,a)=>h.messages.length>0?(u(),d("div",E,[s("div",L,[(u(!0),d(A,null,S(h.messages,e=>(u(),d("div",{key:e.id,class:j(["queued-row",{"is-dragging":i.value===e.id,"is-drop-target":l.value===e.id&&i.value!==e.id}]),draggable:"true",onDragstart:n=>b(n,e.id),onDragover:k(n=>$(e.id),["prevent"]),onDragleave:n=>M(e.id),onDrop:k(n=>x(e.id),["prevent"]),onDragend:p},[s("button",{class:"queued-row-drag",type:"button","aria-label":r(o)("Drag to reorder queued message"),title:r(o)("Drag to reorder queued message")},[...a[0]||(a[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"currentColor",d:"M9 5.5A1.5 1.5 0 1 1 6 5.5a1.5 1.5 0 0 1 3 0m0 6.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8A1.5 1.5 0 1 0 7.5 17a1.5 1.5 0 0 0 0 3m10-13A1.5 1.5 0 1 0 17.5 4a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"})],-1)])],8,F),a[2]||(a[2]=s("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),s("span",N,c(y(e)),1),e.awaitingCompaction?(u(),d("span",Q,c(r(o)("Compacts context before send")),1)):D("",!0),s("div",U,[s("button",{class:"queued-row-edit",type:"button",title:r(o)("Edit queued message"),onClick:n=>t.$emit("edit",e.id)},c(r(o)("Edit")),9,H),s("button",{class:"queued-row-steer",type:"button",title:r(o)("Send now without interrupting work"),onClick:n=>t.$emit("steer",e.id)},c(r(o)("Steer")),9,I),s("button",{class:"queued-row-delete",type:"button","aria-label":r(o)("Delete queued message"),title:r(o)("Delete queued message"),onClick:n=>t.$emit("delete",e.id)},[...a[1]||(a[1]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,O)])],42,z))),128))])])):D("",!0)}}),J=V(P,[["__scopeId","data-v-0fd57c5b"]]);export{J as default};
1
+ import{e as B,f as u,i as d,j as s,F as A,l as S,w as k,n as j,u as r,t as c,k as D,v as T,r as _,_ as V}from"./index-Bcgrj03j.js";const E={key:0,class:"queued-messages"},L={class:"queued-messages-inner"},z=["onDragstart","onDragover","onDragleave","onDrop"],F=["aria-label","title"],N={class:"queued-row-text"},Q={key:0,class:"queued-row-badge"},U={class:"queued-row-actions"},H=["title","onClick"],I=["title","onClick"],O=["aria-label","title","onClick"],P=B({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete","reorder"],setup(h,{emit:q}){const C=q,{t:o}=T(),i=_(""),l=_("");function b(t,a){var e;i.value=a,l.value="",(e=t.dataTransfer)==null||e.setData("text/plain",a),t.dataTransfer&&(t.dataTransfer.effectAllowed="move")}function $(t){!i.value||i.value===t||(l.value=t)}function M(t){l.value===t&&(l.value="")}function x(t){const a=i.value;p(),!(!a||a===t)&&C("reorder",{draggedId:a,targetId:t})}function p(){i.value="",l.value=""}function y(t){var f,w,m;const a=t.text.trim();if(a)return a;const e=[],n=((f=t.imageUrls)==null?void 0:f.length)??0,g=((w=t.fileAttachments)==null?void 0:w.length)??0,v=((m=t.skills)==null?void 0:m.length)??0;return n>0&&e.push(`${n} ${o(n===1?"image":"images")}`),g>0&&e.push(`${g} ${o(g===1?"file":"files")}`),v>0&&e.push(`${v} ${o(v===1?"skill":"skills")}`),e.join(", ")||o("(empty queued message)")}return(t,a)=>h.messages.length>0?(u(),d("div",E,[s("div",L,[(u(!0),d(A,null,S(h.messages,e=>(u(),d("div",{key:e.id,class:j(["queued-row",{"is-dragging":i.value===e.id,"is-drop-target":l.value===e.id&&i.value!==e.id}]),draggable:"true",onDragstart:n=>b(n,e.id),onDragover:k(n=>$(e.id),["prevent"]),onDragleave:n=>M(e.id),onDrop:k(n=>x(e.id),["prevent"]),onDragend:p},[s("button",{class:"queued-row-drag",type:"button","aria-label":r(o)("Drag to reorder queued message"),title:r(o)("Drag to reorder queued message")},[...a[0]||(a[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"currentColor",d:"M9 5.5A1.5 1.5 0 1 1 6 5.5a1.5 1.5 0 0 1 3 0m0 6.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8A1.5 1.5 0 1 0 7.5 17a1.5 1.5 0 0 0 0 3m10-13A1.5 1.5 0 1 0 17.5 4a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"})],-1)])],8,F),a[2]||(a[2]=s("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),s("span",N,c(y(e)),1),e.awaitingCompaction?(u(),d("span",Q,c(r(o)("Compacts context before send")),1)):D("",!0),s("div",U,[s("button",{class:"queued-row-edit",type:"button",title:r(o)("Edit queued message"),onClick:n=>t.$emit("edit",e.id)},c(r(o)("Edit")),9,H),s("button",{class:"queued-row-steer",type:"button",title:r(o)("Send now without interrupting work"),onClick:n=>t.$emit("steer",e.id)},c(r(o)("Steer")),9,I),s("button",{class:"queued-row-delete",type:"button","aria-label":r(o)("Delete queued message"),title:r(o)("Delete queued message"),onClick:n=>t.$emit("delete",e.id)},[...a[1]||(a[1]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,O)])],42,z))),128))])])):D("",!0)}}),J=V(P,[["__scopeId","data-v-0fd57c5b"]]);export{J as default};